| { |
| "exampleMessage": { |
| "id": "use an Id generated by bin/message_id.dart", |
| "subId": 0, |
| "categories": [ |
| "AnalysisOptionsError" |
| ], |
| "template": "#use #named #arguments", |
| "templateHoleOrder": [ |
| "arguments", |
| "named", |
| "use" |
| ], |
| "howToFix": "an explanation on how to fix things", |
| "options": null, |
| "usedBy": [], |
| "examples": [ |
| " Some multiline example;\n That generates the bug.", |
| { |
| "fileA.dart": " or a map from file to content.\n again multiline", |
| "fileB.dart": " with possibly multiple files.\n muliline too" |
| } |
| ] |
| }, |
| "CONST_CONSTRUCTOR_WITH_BODY": { |
| "id": "LGJGHW", |
| "subId": 0, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Const constructor can't have a body.", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing the 'const' keyword or the body.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer", |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| " class C {\n const C() {}\n }\n\n main() => new C();" |
| ] |
| }, |
| "CONST_FACTORY": { |
| "id": "LGJGHW", |
| "subId": 1, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Only redirecting factory constructors can be declared to be 'const'.", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing the 'const' keyword or replacing the body with '=' followed by a valid target.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer", |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| " class C {\n const factory C() {}\n }\n\n main() => new C();" |
| ] |
| }, |
| "EXTRANEOUS_MODIFIER": { |
| "id": "GRKIQE", |
| "subId": 0, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Can't have modifier '#{modifier}' here.", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing '#{modifier}'.", |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| "var String foo; main(){}", |
| "var set foo; main(){}", |
| "var final foo; main(){}", |
| "var var foo; main(){}", |
| "var const foo; main(){}", |
| "var abstract foo; main(){}", |
| "var static foo; main(){}", |
| "var external foo; main(){}", |
| "get var foo; main(){}", |
| "set var foo; main(){}", |
| "final var foo; main(){}", |
| "var var foo; main(){}", |
| "const var foo; main(){}", |
| "abstract var foo; main(){}", |
| "static var foo; main(){}", |
| "external var foo; main(){}" |
| ] |
| }, |
| "EXTRANEOUS_MODIFIER_REPLACE": { |
| "id": "GRKIQE", |
| "subId": 1, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Can't have modifier '#{modifier}' here.", |
| "templateHoleOrder": null, |
| "howToFix": "Try replacing modifier '#{modifier}' with 'var', 'final', or a type.", |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| "set foo; main(){}", |
| "abstract foo; main(){}", |
| "static foo; main(){}", |
| "external foo; main(){}" |
| ] |
| }, |
| "CONST_CLASS": { |
| "id": "GRKIQE", |
| "subId": 2, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Classes can't be declared to be 'const'.", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing the 'const' keyword or moving to the class' constructor(s).", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| " const class C {}\n\n main() => new C();\n " |
| ] |
| }, |
| "CONST_METHOD": { |
| "id": "GRKIQE", |
| "subId": 3, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Getters, setters and methods can't be declared to be 'const'.", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing the 'const' keyword.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "const int foo() => 499; main() {}", |
| "const int get foo => 499; main() {}", |
| "const set foo(v) => 499; main() {}", |
| "class A { const int foo() => 499; } main() { new A(); }", |
| "class A { const int get foo => 499; } main() { new A(); }", |
| "class A { const set foo(v) => 499; } main() { new A(); }" |
| ] |
| }, |
| "CONST_ENUM": { |
| "id": "GRKIQE", |
| "subId": 4, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Enums can't be declared to be 'const'.", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing the 'const' keyword.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "const enum Foo { x } main() {}" |
| ] |
| }, |
| "CONST_TYPEDEF": { |
| "id": "GRKIQE", |
| "subId": 5, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Type aliases can't be declared to be 'const'.", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing the 'const' keyword.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "const typedef void Foo(); main() {}" |
| ] |
| }, |
| "CONST_AND_FINAL": { |
| "id": "GRKIQE", |
| "subId": 6, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Members can't be declared to be both 'const' and 'final'.", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing either the 'const' or 'final' keyword.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "final const int x = 499; main() {}", |
| "const final int x = 499; main() {}", |
| "class A { static final const int x = 499; } main() {}", |
| "class A { static const final int x = 499; } main() {}" |
| ] |
| }, |
| "CONST_AND_VAR": { |
| "id": "GRKIQE", |
| "subId": 7, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Members can't be declared to be both 'const' and 'var'.", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing either the 'const' or 'var' keyword.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "var const x = 499; main() {}", |
| "const var x = 499; main() {}", |
| "class A { var const x = 499; } main() {}", |
| "class A { const var x = 499; } main() {}" |
| ] |
| }, |
| "CLASS_IN_CLASS": { |
| "id": "DOTHQH", |
| "subId": 0, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Classes can't be declared inside other classes.", |
| "templateHoleOrder": null, |
| "howToFix": "Try moving the class to the top-level.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "class A { class B {} } main() { new A(); }" |
| ] |
| }, |
| "CONSTRUCTOR_WITH_RETURN_TYPE": { |
| "id": "VOJBWY", |
| "subId": 0, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Constructors can't have a return type.", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing the return type.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer", |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| "class A { int A() {} } main() { new A(); }" |
| ] |
| }, |
| "MISSING_EXPRESSION_IN_THROW": { |
| "id": "FTGGMJ", |
| "subId": 0, |
| "categories": [ |
| "ParserError" |
| ], |
| "template": "Missing expression after 'throw'.", |
| "templateHoleOrder": null, |
| "howToFix": "Did you mean 'rethrow'?", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer", |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| "main() { throw; }", |
| "main() { try { throw 0; } catch(e) { throw; } }" |
| ] |
| }, |
| "RETHROW_OUTSIDE_CATCH": { |
| "id": "MWETLC", |
| "subId": 0, |
| "categories": [ |
| "CompileTimeError" |
| ], |
| "template": "Rethrow must be inside of catch clause.", |
| "templateHoleOrder": null, |
| "howToFix": "Try moving the expression into a catch clause, or using a 'throw' expression.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer", |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| "main() { rethrow; }" |
| ] |
| }, |
| "RETURN_IN_GENERATIVE_CONSTRUCTOR": { |
| "id": "UOTDQH", |
| "subId": 0, |
| "categories": [ |
| "CompileTimeError" |
| ], |
| "template": "Constructors can't return values.", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing the return statement or using a factory constructor.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer", |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| " class C {\n C() {\n return 1;\n }\n }\n\n main() => new C();" |
| ] |
| }, |
| "RETURN_IN_GENERATOR": { |
| "id": "JRUTUQ", |
| "subId": 0, |
| "categories": [ |
| "CompileTimeError" |
| ], |
| "template": "Can't return a value from a generator function (using the '#{modifier}' modifier).", |
| "templateHoleOrder": null, |
| "howToFix": "Try removing the value, replacing 'return' with 'yield' or changing the method body modifier.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer", |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| " foo() async* { return 0; }\n main() => foo();\n ", |
| " foo() sync* { return 0; }\n main() => foo();\n " |
| ] |
| }, |
| "NOT_ASSIGNABLE": { |
| "id": "FYQYXB", |
| "subId": 0, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "'#{fromType}' is not assignable to '#{toType}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js" |
| ], |
| "examples": null |
| }, |
| "FORIN_NOT_ASSIGNABLE": { |
| "id": "FYQYXB", |
| "subId": 1, |
| "categories": [ |
| "Hint" |
| ], |
| "template": "The element type '#{currentType}' of '#{expressionType}' is not assignable to '#{elementType}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| " main() {\n List<int> list = <int>[1, 2];\n for (String x in list) x;\n }\n " |
| ] |
| }, |
| "RETURN_OF_INVALID_TYPE": { |
| "id": "FYQYXB", |
| "subId": 2, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "The return type '#{fromType}' is not a '#{toType}', as defined by the method '#{method}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "int foo() => 'foo'; main() { foo(); }" |
| ] |
| }, |
| "ARGUMENT_TYPE_NOT_ASSIGNABLE": { |
| "id": "FYQYXB", |
| "subId": 3, |
| "categories": [ |
| "Hint", |
| "StaticWarning" |
| ], |
| "template": "The argument type '#{fromType}' cannot be assigned to the parameter type '#{toType}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "foo(int x) => x; main() { foo('bar'); }" |
| ] |
| }, |
| "CANNOT_RESOLVE": { |
| "id": "ERUSKD", |
| "subId": 0, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "Can't resolve '#{name}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js" |
| ], |
| "examples": null |
| }, |
| "UNDEFINED_METHOD": { |
| "id": "ERUSKD", |
| "subId": 1, |
| "categories": [ |
| "StaticTypeWarning", |
| "Hint" |
| ], |
| "template": "The method '#{memberName}' is not defined for the class '#{className}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js", |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| " class A {\n foo() { bar(); }\n }\n main() { new A().foo(); }\n " |
| ] |
| }, |
| "UNDEFINED_METHOD_WITH_CONSTRUCTOR": { |
| "id": "ERUSKD", |
| "subId": 2, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "The method '#{memberName}' is not defined for the class '#{className}', but a constructor with that name is defined.", |
| "templateHoleOrder": null, |
| "howToFix": "Try adding 'new' or 'const' to invoke the constuctor, or change the method name.", |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| " class A {\n A.bar() {}\n }\n main() { A.bar(); }\n " |
| ] |
| }, |
| "UNDEFINED_GETTER": { |
| "id": "ERUSKD", |
| "subId": 3, |
| "categories": [ |
| "StaticTypeWarning", |
| "StaticWarning", |
| "Hint" |
| ], |
| "template": "The getter '#{memberName}' is not defined for the class '#{className}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js", |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "class A {} main() { new A().x; }", |
| "class A {} main() { A.x; }" |
| ] |
| }, |
| "UNDEFINED_ENUM_CONSTANT": { |
| "id": "ERUSKD", |
| "subId": 4, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "There is no constant named '#{memberName}' in '#{className}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| " enum E { ONE }\n E e() { return E.TWO; }\n main() { e(); }\n " |
| ] |
| }, |
| "UNDEFINED_INSTANCE_GETTER_BUT_SETTER": { |
| "id": "ERUSKD", |
| "subId": 5, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "The setter '#{memberName}' in class '#{className}' can not be used as a getter.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| "class A { set x(y) {} } main() { new A().x; }" |
| ] |
| }, |
| "UNDEFINED_OPERATOR": { |
| "id": "ERUSKD", |
| "subId": 6, |
| "categories": [ |
| "StaticTypeWarning", |
| "Hint" |
| ], |
| "template": "The operator '#{memberName}' is not defined for the class '#{className}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js", |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "class A {} main() { new A() + 3; }" |
| ] |
| }, |
| "UNDEFINED_SETTER": { |
| "id": "ERUSKD", |
| "subId": 7, |
| "categories": [ |
| "StaticTypeWarning", |
| "StaticWarning", |
| "Hint" |
| ], |
| "template": "The setter '#{memberName}' is not defined for the class '#{className}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js", |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "class A {} main() { new A().x = 499; }" |
| ] |
| }, |
| "NO_SUCH_SUPER_MEMBER": { |
| "id": "ERUSKD", |
| "subId": 8, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "Can't resolve '#{memberName}' in a superclass of '#{className}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js" |
| ], |
| "examples": null |
| }, |
| "UNDEFINED_SUPER_GETTER": { |
| "id": "ERUSKD", |
| "subId": 9, |
| "categories": [ |
| "StaticTypeWarning", |
| "StaticWarning" |
| ], |
| "template": "The getter '#{memberName}' is not defined in a superclass of '#{className}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| " class A {}\n class B extends A {\n foo() => super.x;\n }\n main() { new B().foo(); }\n " |
| ] |
| }, |
| "UNDEFINED_SUPER_METHOD": { |
| "id": "ERUSKD", |
| "subId": 10, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "The method '#{memberName}' is not defined in a superclass of '#{className}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| " class A {}\n class B extends A {\n foo() => super.x();\n }\n main() { new B().foo(); }\n " |
| ] |
| }, |
| "UNDEFINED_SUPER_OPERATOR": { |
| "id": "ERUSKD", |
| "subId": 11, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "The operator '#{memberName}' is not defined in a superclass of '#{className}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| " class A {}\n class B extends A {\n foo() => super + 499;\n }\n main() { new B().foo(); }\n " |
| ] |
| }, |
| "UNDEFINED_SUPER_SETTER": { |
| "id": "ERUSKD", |
| "subId": 12, |
| "categories": [ |
| "StaticTypeWarning", |
| "StaticWarning" |
| ], |
| "template": "The setter '#{memberName}' is not defined in a superclass of '#{className}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer", |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| " class A {}\n class B extends A {\n foo() { super.x = 499; }\n }\n main() { new B().foo(); }\n " |
| ] |
| }, |
| "UNDEFINED_FUNCTION": { |
| "id": "ERUSKD", |
| "subId": 13, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "The function '#{memberName}' is not defined.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.analyzer" |
| ], |
| "examples": [ |
| "main() { foo(); }" |
| ] |
| }, |
| "UNDEFINED_STATIC_GETTER_BUT_SETTER": { |
| "id": "ERUSKD", |
| "subId": 14, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "Cannot resolve getter '#{name}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| "set foo(x) {} main() { foo; }" |
| ] |
| }, |
| "UNDEFINED_STATIC_SETTER_BUT_GETTER": { |
| "id": "ERUSKD", |
| "subId": 15, |
| "categories": [ |
| "StaticTypeWarning" |
| ], |
| "template": "Cannot resolve setter '#{name}'.", |
| "templateHoleOrder": null, |
| "howToFix": null, |
| "options": null, |
| "usedBy": [ |
| "Platform.dart2js" |
| ], |
| "examples": [ |
| " main() {\n final x = 1;\n x = 2;\n }", |
| " main() {\n const x = 1;\n x = 2;\n }\n ", |
| " final x = 1;\n main() { x = 3; }\n ", |
| " const x = 1;\n main() { x = 3; }\n ", |
| "get foo => null main() { foo = 5; }", |
| "const foo = 0 main() { foo = 5; }" |
| ] |
| } |
| } |