mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:58:29 +00:00
7d65fec76e
This is the same as https://dart-review.googlesource.com/24481, but with additional status file fixes. Change-Id: Ic076c4dbf9c07e0fdf316298ca1ee1b6ce25002b Reviewed-on: https://dart-review.googlesource.com/25508 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
1569 lines
49 KiB
YAML
1569 lines
49 KiB
YAML
# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
# Each entry in this map corresponds to a diagnostic message. Ideally, each
|
|
# entry contains three parts:
|
|
#
|
|
# 1. A message template (template).
|
|
#
|
|
# 2. A suggestion for how to correct the problem (tip).
|
|
#
|
|
# 3. Examples that produce the message (one of expression, statement,
|
|
# declaration, member, script, or bytes).
|
|
#
|
|
# A message shouldn't indicate which kind of diagnostic it is, for example,
|
|
# warning or error. Tools are expected to prepend "Warning: ", or "Error: ",
|
|
# and should be allowed to change the kind of diagnostic without affecting the
|
|
# message. For example, an error might be turned into a warning by the tool.
|
|
#
|
|
# See the file [lib/src/fasta/diagnostics.md] for more details on how to write
|
|
# good diagnostic messages.
|
|
#
|
|
# A message used for internal errors should have key that starts with
|
|
# "InternalProblem". This way, UX review can prioritize it accordingly.
|
|
#
|
|
# Eventually, we'd like to have all diagnostics in one shared
|
|
# location. However, for now, dart2js and the analyzer needs to translate error
|
|
# codes to their own format. To support this, an entry can contain an analyzer
|
|
# error code (analyzerCode) and a dart2js error code (dart2jsCode).
|
|
#
|
|
# For dart2js, there's a few special error codes:
|
|
#
|
|
# - `*ignored*` this error is ignored by dart2js (normally a recoverable parser
|
|
# error that dart2js reports in later phase for historical reasons).
|
|
#
|
|
# - `*fatal*` this is an error that is considered fatal by dart2js (normally a
|
|
# recoverable parser error that dart2js can't reliably recover from).
|
|
#
|
|
# dart2js only needs to translate error generated by the parser or scanner, so
|
|
# only lexical and syntactical errors have a code for dart2js. Long term, we
|
|
# assume that dart2js will rely solely on the front-end to report errors.
|
|
#
|
|
# Long term, the analyzer and front-end need to share the same error codes. So
|
|
# eventually all error codes should have an `analyzerCode` field.
|
|
#
|
|
# ## Parameter Substitution in Template and Tip
|
|
#
|
|
# The fields `template` and `tip` are subject to parameter substitution. When
|
|
# the compiler reports a problem, it may also specify a map with the following
|
|
# keys to be substituted into the message:
|
|
#
|
|
# `#character` a Unicode character.
|
|
#
|
|
# `#unicode` a Unicode short identifier (U+xxxx). We use this to represent code
|
|
# units or code points.
|
|
#
|
|
# `#name` a name (a string).
|
|
#
|
|
# `#name2` another name (a string).
|
|
#
|
|
# `#lexeme` a token. The token's `lexeme` property is used.
|
|
#
|
|
# `#string` a string.
|
|
#
|
|
# `#string2` another string.
|
|
#
|
|
# `#uri` a Uri.
|
|
|
|
AsciiControlCharacter:
|
|
template: "The control character #unicode can only be used in strings and comments."
|
|
dart2jsCode: BAD_INPUT_CHARACTER
|
|
analyzerCode: ILLEGAL_CHARACTER
|
|
expression: "\x1b 1"
|
|
|
|
NonAsciiIdentifier:
|
|
template: "The non-ASCII character '#character' (#unicode) can't be used in identifiers, only in strings and comments."
|
|
tip: "Try using an US-ASCII letter, a digit, '_' (an underscore), or '$' (a dollar sign)."
|
|
analyzerCode: ILLEGAL_CHARACTER
|
|
dart2jsCode: BAD_INPUT_CHARACTER
|
|
expression: "å"
|
|
|
|
NonAsciiWhitespace:
|
|
template: "The non-ASCII space character #unicode can only be used in strings and comments."
|
|
analyzerCode: ILLEGAL_CHARACTER
|
|
dart2jsCode: BAD_INPUT_CHARACTER
|
|
expression: "\u2028 1"
|
|
|
|
Encoding:
|
|
template: "Unable to decode bytes as UTF-8."
|
|
dart2jsCode: "*fatal*"
|
|
bytes: [255]
|
|
|
|
EmptyNamedParameterList:
|
|
template: "Named parameter lists cannot be empty."
|
|
tip: "Try adding a named parameter to the list."
|
|
dart2jsCode: EMPTY_NAMED_PARAMETER_LIST
|
|
script: >
|
|
foo({}) {}
|
|
|
|
main() {
|
|
foo();
|
|
}
|
|
|
|
EmptyOptionalParameterList:
|
|
template: "Optional parameter lists cannot be empty."
|
|
tip: "Try adding an optional parameter to the list."
|
|
dart2jsCode: EMPTY_OPTIONAL_PARAMETER_LIST
|
|
script: >
|
|
foo([]) {}
|
|
|
|
main() {
|
|
foo();
|
|
}
|
|
|
|
ExpectedBlock:
|
|
template: "Expected a block."
|
|
tip: "Try adding {}."
|
|
analyzerCode: EXPECTED_TOKEN
|
|
dart2jsCode: "*fatal*"
|
|
script: "try finally {}"
|
|
|
|
ExpectedBlockToSkip:
|
|
template: "Expected a function body or '=>'."
|
|
# TODO(ahe): In some scenarios, we can suggest removing the 'static' keyword.
|
|
tip: "Try adding {}."
|
|
analyzerCode: MISSING_FUNCTION_BODY
|
|
dart2jsCode: NATIVE_OR_BODY_EXPECTED
|
|
script: "main();"
|
|
|
|
ExpectedBody:
|
|
template: "Expected a function body or '=>'."
|
|
# TODO(ahe): In some scenarios, we can suggest removing the 'static' keyword.
|
|
tip: "Try adding {}."
|
|
analyzerCode: MISSING_FUNCTION_BODY
|
|
dart2jsCode: BODY_EXPECTED
|
|
script: "main();"
|
|
|
|
ExpectedButGot:
|
|
template: "Expected '#string' before this."
|
|
# Consider the second example below: the parser expects a ')' before 'y', but
|
|
# a ',' would also have worked. We don't have enough information to give a
|
|
# good suggestion.
|
|
analyzerCode: UNEXPECTED_TOKEN
|
|
dart2jsCode: MISSING_TOKEN_BEFORE_THIS
|
|
script:
|
|
- "main() => true ? 1;"
|
|
- "main() => foo(x: 1 y: 2);"
|
|
|
|
MultipleLibraryDirectives:
|
|
template: "Only one library directive may be declared in a file."
|
|
tip: "Try removing all but one of the library directives."
|
|
analyzerCode: MULTIPLE_LIBRARY_DIRECTIVES
|
|
dart2jsCode: "*ignored*"
|
|
|
|
MultipleExtends:
|
|
template: "Each class definition can have at most one extends clause."
|
|
tip: "Try choosing one superclass and define your class to implement (or mix in) the others."
|
|
analyzerCode: MULTIPLE_EXTENDS_CLAUSES
|
|
dart2jsCode: "*ignored*"
|
|
script: "class A extends B extends C {}"
|
|
|
|
MultipleWith:
|
|
template: "Each class definition can have at most one with clause."
|
|
tip: "Try combining all of the with clauses into a single clause."
|
|
analyzerCode: MULTIPLE_WITH_CLAUSES
|
|
dart2jsCode: "*ignored*"
|
|
script: "class A extends B with C, D with E {}"
|
|
|
|
WithWithoutExtends:
|
|
template: "The with clause can't be used without an extends clause."
|
|
tip: "Try adding an extends clause such as 'extends Object'."
|
|
analyzerCode: WITH_WITHOUT_EXTENDS
|
|
dart2jsCode: "GENERIC"
|
|
script: "class A with B, C {}"
|
|
|
|
WithBeforeExtends:
|
|
template: "The extends clause must be before the with clause."
|
|
tip: "Try moving the extends clause before the with clause."
|
|
analyzerCode: WITH_BEFORE_EXTENDS
|
|
dart2jsCode: "*ignored*"
|
|
script: "class A with B extends C {}"
|
|
|
|
ImplementsBeforeExtends:
|
|
template: "The extends clause must be before the implements clause."
|
|
tip: "Try moving the extends clause before the implements clause."
|
|
analyzerCode: IMPLEMENTS_BEFORE_EXTENDS
|
|
dart2jsCode: "*ignored*"
|
|
script: "class A implements B extends C {}"
|
|
|
|
ImplementsBeforeWith:
|
|
template: "The with clause must be before the implements clause."
|
|
tip: "Try moving the with clause before the implements clause."
|
|
analyzerCode: IMPLEMENTS_BEFORE_WITH
|
|
dart2jsCode: "*ignored*"
|
|
script: "class A extends B implements C with D {}"
|
|
|
|
MultipleImplements:
|
|
template: "Each class definition can have at most one implements clause."
|
|
tip: "Try combining all of the implements clauses into a single clause."
|
|
analyzerCode: MULTIPLE_IMPLEMENTS_CLAUSES
|
|
dart2jsCode: "GENERIC"
|
|
script: "class A implements B implements C, D {}"
|
|
|
|
ExpectedClassBody:
|
|
template: "Expected a class body, but got '#lexeme'."
|
|
analyzerCode: MISSING_CLASS_BODY
|
|
dart2jsCode: "*fatal*"
|
|
|
|
ExpectedClassBodyToSkip: ExpectedClassBody
|
|
|
|
ExpectedDeclaration:
|
|
template: "Expected a declaration, but got '#lexeme'."
|
|
analyzerCode: EXPECTED_EXECUTABLE
|
|
dart2jsCode: "*fatal*"
|
|
|
|
ExpectedClassMember:
|
|
template: "Expected a class member, but got '#lexeme'."
|
|
analyzerCode: EXPECTED_CLASS_MEMBER
|
|
dart2jsCode: "*fatal*"
|
|
|
|
ExpectedFunctionBody:
|
|
template: "Expected a function body, but got '#lexeme'."
|
|
analyzerCode: MISSING_FUNCTION_BODY
|
|
dart2jsCode: NATIVE_OR_FATAL
|
|
|
|
ExpectedHexDigit:
|
|
template: "A hex digit (0-9 or A-F) must follow '0x'."
|
|
# No tip, seems obvious from the error message.
|
|
analyzerCode: MISSING_HEX_DIGIT
|
|
dart2jsCode: HEX_DIGIT_EXPECTED
|
|
script: >
|
|
main() {
|
|
var i = 0x;
|
|
}
|
|
|
|
ExpectedIdentifier:
|
|
template: "Expected an identifier, but got '#lexeme'."
|
|
analyzerCode: MISSING_IDENTIFIER
|
|
dart2jsCode: EXPECTED_IDENTIFIER
|
|
script: "do() {} main() {}"
|
|
|
|
EqualityCannotBeEqualityOperand:
|
|
template: "An equality expression can't be an operand of another equality expression."
|
|
tip: "Try re-writing the expression."
|
|
analyzerCode: EQUALITY_CANNOT_BE_EQUALITY_OPERAND
|
|
dart2jsCode: "*fatal*"
|
|
script:
|
|
- "main() { var b = a < b < c; }"
|
|
- "main() { var b = a == b != c; }"
|
|
|
|
ExpectedOpenParens:
|
|
template: "Expected '('."
|
|
dart2jsCode: GENERIC
|
|
|
|
ExpectedString:
|
|
template: "Expected a String, but got '#lexeme'."
|
|
analyzerCode: EXPECTED_STRING_LITERAL
|
|
dart2jsCode: "*fatal*"
|
|
|
|
ExpectedToken:
|
|
template: "Expected to find '#string'."
|
|
analyzerCode: EXPECTED_TOKEN
|
|
dart2jsCode: GENERIC
|
|
|
|
ExpectedType:
|
|
template: "Expected a type, but got '#lexeme'."
|
|
analyzerCode: EXPECTED_TYPE_NAME
|
|
dart2jsCode: "*fatal*"
|
|
|
|
MissingConstFinalVarOrType:
|
|
template: "Variables must be declared using the keywords 'const', 'final', 'var' or a type name."
|
|
tip: "Try adding the name of the type of the variable or the keyword 'var'."
|
|
analyzerCode: MISSING_CONST_FINAL_VAR_OR_TYPE
|
|
dart2jsCode: "*fatal*"
|
|
script:
|
|
- "class C { static f; }"
|
|
|
|
AbstractClassMember:
|
|
template: "Members of classes can't be declared to be 'abstract'."
|
|
tip: "Try removing the 'abstract' keyword. You can add the 'abstract' keyword before the class declaration."
|
|
analyzerCode: ABSTRACT_CLASS_MEMBER
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "abstract class C {abstract C.c();}"
|
|
- "abstract class C {abstract m();}"
|
|
- "abstract class C {abstract get m;}"
|
|
- "abstract class C {abstract set m(int x);}"
|
|
- "abstract class C {abstract f;}"
|
|
- "abstract class C {abstract static f;}"
|
|
|
|
ClassInClass:
|
|
template: "Classes can't be declared inside other classes."
|
|
tip: "Try moving the class to the top-level."
|
|
analyzerCode: CLASS_IN_CLASS
|
|
dart2jsCode: "*fatal*"
|
|
script:
|
|
- "class C { class B {} }"
|
|
|
|
EnumInClass:
|
|
template: "Enums can't be declared inside classes."
|
|
tip: "Try moving the enum to the top-level."
|
|
analyzerCode: ENUM_IN_CLASS
|
|
dart2jsCode: "*fatal*"
|
|
script:
|
|
- "class Foo { enum Bar { Bar1, Bar2, Bar3 } }"
|
|
|
|
TypedefInClass:
|
|
template: "Typedefs can't be declared inside classes."
|
|
tip: "Try moving the typedef to the top-level."
|
|
analyzerCode: TYPEDEF_IN_CLASS
|
|
dart2jsCode: "*fatal*"
|
|
script:
|
|
- "class C { typedef int F(int x); }"
|
|
|
|
CovariantMember:
|
|
template: "Getters, setters and methods can't be declared to be 'covariant'."
|
|
tip: "Try removing the 'covariant' keyword."
|
|
analyzerCode: COVARIANT_MEMBER
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "static covariant get x => 0;"
|
|
- "covariant int m() => 0;"
|
|
|
|
VarReturnType:
|
|
template: "The return type can't be 'var'."
|
|
tip: "Try removing the keyword 'var', or replacing it with the name of the return type."
|
|
analyzerCode: VAR_RETURN_TYPE
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { var m() {} }"
|
|
- "class C { var C() {} }"
|
|
|
|
ConstClass:
|
|
template: "Classes can't be declared to be 'const'."
|
|
tip: "Try removing the 'const' keyword. If you're trying to indicate that instances of the class can be constants, place the 'const' keyword on the class' constructor(s)."
|
|
analyzerCode: CONST_CLASS
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script: "const class C {}"
|
|
|
|
ConstAndCovariant:
|
|
template: "Members can't be declared to be both 'const' and 'covariant'."
|
|
tip: "Try removing either the 'const' or 'covariant' keyword."
|
|
analyzerCode: CONST_AND_COVARIANT
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "class C { covariant const C f; }"
|
|
- "class C { const covariant C f; }"
|
|
|
|
ConstAndFinal:
|
|
template: "Members can't be declared to be both 'const' and 'final'."
|
|
tip: "Try removing either the 'const' or 'final' keyword."
|
|
analyzerCode: CONST_AND_FINAL
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { const final int x; }"
|
|
- "class C { final const int x; }"
|
|
|
|
ConstAndVar:
|
|
template: "Members can't be declared to be both 'const' and 'var'."
|
|
tip: "Try removing either the 'const' or 'var' keyword."
|
|
analyzerCode: CONST_AND_VAR
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { const var x; }"
|
|
- "class C { var const x; }"
|
|
|
|
ConstFactory:
|
|
template: "Only redirecting factory constructors can be declared to be 'const'."
|
|
tip: "Try removing the 'const' keyword, or replacing the body with '=' followed by a valid target."
|
|
analyzerCode: CONST_FACTORY
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "class C { const factory C() {} }"
|
|
|
|
ConstAfterFactory:
|
|
template: "The modifier 'const' should be before the modifier 'factory'."
|
|
tip: "Try re-ordering the modifiers."
|
|
analyzerCode: CONST_AFTER_FACTORY
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "class C { factory const C() = prefix.B.foo; }"
|
|
|
|
CovariantAfterFinal:
|
|
template: "The modifier 'covariant' should be before the modifier 'final'."
|
|
tip: "Try re-ordering the modifiers."
|
|
analyzerCode: COVARIANT_AFTER_FINAL
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "final covariant f;"
|
|
|
|
CovariantAfterVar:
|
|
template: "The modifier 'covariant' should be before the modifier 'var'."
|
|
tip: "Try re-ordering the modifiers."
|
|
analyzerCode: COVARIANT_AFTER_VAR
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "var covariant f;"
|
|
|
|
CovariantAndStatic:
|
|
template: "Members can't be declared to be both 'covariant' and 'static'."
|
|
tip: "Try removing either the 'covariant' or 'static' keyword."
|
|
analyzerCode: COVARIANT_AND_STATIC
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { covariant static A f; }"
|
|
- "class C { static covariant A f; }"
|
|
|
|
DuplicatedModifier:
|
|
template: "The modifier '#lexeme' was already specified."
|
|
tip: "Try removing all but one occurance of the modifier."
|
|
analyzerCode: DUPLICATED_MODIFIER
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { const const m; }"
|
|
- "class C { external external f(); }"
|
|
- "class C { final final m; }"
|
|
- "class C { static static var m; }"
|
|
- "class C { var var m; }"
|
|
|
|
ExternalAfterConst:
|
|
template: "The modifier 'external' should be before the modifier 'const'."
|
|
tip: "Try re-ordering the modifiers."
|
|
analyzerCode: EXTERNAL_AFTER_CONST
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { const external C(); }"
|
|
|
|
ExternalAfterFactory:
|
|
template: "The modifier 'external' should be before the modifier 'factory'."
|
|
tip: "Try re-ordering the modifiers."
|
|
analyzerCode: EXTERNAL_AFTER_FACTORY
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "class C { factory external C(); }"
|
|
|
|
ExternalAfterStatic:
|
|
template: "The modifier 'external' should be before the modifier 'static'."
|
|
tip: "Try re-ordering the modifiers."
|
|
analyzerCode: EXTERNAL_AFTER_STATIC
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { static external f(); }"
|
|
|
|
ExternalConstructorWithBody:
|
|
template: "External constructors can't have a body."
|
|
tip: "Try removing the body of the constructor, or removing the keyword 'external'."
|
|
analyzerCode: EXTERNAL_CONSTRUCTOR_WITH_BODY
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "class C { external C() {} }"
|
|
|
|
ExternalFactoryWithBody:
|
|
template: "External factories can't have a body."
|
|
tip: "Try removing the body of the factory, or removing the keyword 'external'."
|
|
analyzerCode: EXTERNAL_CONSTRUCTOR_WITH_BODY
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "class C { external factory C() {} }"
|
|
|
|
ExternalField:
|
|
template: "Fields can't be declared to be 'external'."
|
|
tip: "Try removing the keyword 'external'."
|
|
analyzerCode: EXTERNAL_FIELD
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { external var f; }"
|
|
|
|
ExtraneousModifier:
|
|
template: "Can't have modifier '#lexeme' here."
|
|
tip: "Try removing '#lexeme'."
|
|
analyzerCode: EXTRANEOUS_MODIFIER
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "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(){}"
|
|
- "set foo; main(){}"
|
|
- "abstract foo; main(){}"
|
|
- "static foo; main(){}"
|
|
- "external foo; main(){}"
|
|
- "final class C {}"
|
|
- "abstract enum foo {bar}"
|
|
- "const enum foo {bar}"
|
|
- "final enum foo {bar}"
|
|
- "abstract void foo() {}"
|
|
- "static void foo() {}"
|
|
- "abstract typedef foo();"
|
|
- "const typedef foo();"
|
|
- "final typedef foo();"
|
|
- "static typedef foo();"
|
|
|
|
FinalAndCovariant:
|
|
template: "Members can't be declared to be both 'final' and 'covariant'."
|
|
tip: "Try removing either the 'final' or 'covariant' keyword."
|
|
analyzerCode: FINAL_AND_COVARIANT
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "class C { covariant final f; }"
|
|
- "class C { final covariant f; }"
|
|
|
|
FinalAndVar:
|
|
template: "Members can't be declared to be both 'final' and 'var'."
|
|
tip: "Try removing the keyword 'var'."
|
|
analyzerCode: FINAL_AND_VAR
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { final var x; }"
|
|
- "class C { var final x; }"
|
|
|
|
StaticAfterConst:
|
|
template: "The modifier 'static' should be before the modifier 'const'."
|
|
tip: "Try re-ordering the modifiers."
|
|
analyzerCode: STATIC_AFTER_CONST
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { const static int f; }"
|
|
|
|
StaticAfterFinal:
|
|
template: "The modifier 'static' should be before the modifier 'final'."
|
|
tip: "Try re-ordering the modifiers."
|
|
analyzerCode: STATIC_AFTER_FINAL
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { final static int f; }"
|
|
|
|
StaticAfterVar:
|
|
template: "The modifier 'static' should be before the modifier 'var'."
|
|
tip: "Try re-ordering the modifiers."
|
|
analyzerCode: STATIC_AFTER_VAR
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "class C { var static f; }"
|
|
|
|
StaticOperator:
|
|
template: "Operators can't be static."
|
|
tip: "Try removing the keyword 'static'."
|
|
analyzerCode: STATIC_OPERATOR
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
script:
|
|
- "class C { static operator +(int x) => x + 1; }"
|
|
|
|
InvalidAwaitFor:
|
|
template: "The keyword 'await' isn't allowed for a normal 'for' statement."
|
|
tip: "Try removing the keyword, or use a for-each statement."
|
|
analyzerCode: INVALID_AWAIT_IN_FOR
|
|
dart2jsCode: INVALID_AWAIT_FOR
|
|
script:
|
|
- "f() async {await for (int i = 0; i < 5; i++) {}}"
|
|
|
|
InvalidSyncModifier:
|
|
template: "Invalid modifier 'sync'."
|
|
tip: "Try replacing 'sync' with 'sync*'."
|
|
analyzerCode: MISSING_STAR_AFTER_SYNC
|
|
dart2jsCode: INVALID_SYNC_MODIFIER
|
|
script: "main() sync {}"
|
|
|
|
InvalidVoid:
|
|
template: "Type 'void' can't be used here because it isn't a return type."
|
|
tip: "Try removing 'void' keyword or replace it with 'var', 'final', or a type."
|
|
dart2jsCode: VOID_NOT_ALLOWED
|
|
script:
|
|
- "void x; main() {}"
|
|
- "foo(void x) {} main() { foo(null); }"
|
|
|
|
InvalidInitializer:
|
|
template: "Not a valid initializer."
|
|
tip: "To initialize a field, use the syntax 'name = value'."
|
|
|
|
MissingExponent:
|
|
template: "Numbers in exponential notation should always contain an exponent (an integer number with an optional sign)."
|
|
tip: "Make sure there is an exponent, and remove any whitespace before it."
|
|
analyzerCode: MISSING_DIGIT
|
|
dart2jsCode: EXPONENT_MISSING
|
|
script: >
|
|
main() {
|
|
var i = 1e;
|
|
}
|
|
|
|
PositionalParameterWithEquals:
|
|
template: "Positional optional parameters can't use ':' to specify a default value."
|
|
tip: "Try replacing ':' with '='."
|
|
analyzerCode: WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER
|
|
dart2jsCode: POSITIONAL_PARAMETER_WITH_EQUALS
|
|
script: >
|
|
main() {
|
|
foo([a: 1]) => print(a);
|
|
foo(2);
|
|
}
|
|
|
|
RequiredParameterWithDefault:
|
|
template: "Non-optional parameters can't have a default value."
|
|
tip: "Try removing the default value or making the parameter optional."
|
|
dart2jsCode: REQUIRED_PARAMETER_WITH_DEFAULT
|
|
script:
|
|
- >
|
|
main() {
|
|
foo(a: 1) => print(a);
|
|
foo(2);
|
|
}
|
|
- >
|
|
main() {
|
|
foo(a = 1) => print(a);
|
|
foo(2);
|
|
}
|
|
|
|
StackOverflow:
|
|
template: "Stack overflow."
|
|
dart2jsCode: GENERIC
|
|
|
|
UnexpectedDollarInString:
|
|
template: "A '$' has special meaning inside a string, and must be followed by an identifier or an expression in curly braces ({})."
|
|
tip: "Try adding a backslash (\\) to escape the '$'."
|
|
dart2jsCode: MALFORMED_STRING_LITERAL
|
|
script:
|
|
- >
|
|
main() {
|
|
return '$';
|
|
}
|
|
- >
|
|
main() {
|
|
return "$";
|
|
}
|
|
- >
|
|
main() {
|
|
return '''$''';
|
|
}
|
|
- >
|
|
main() {
|
|
return """$""";
|
|
}
|
|
|
|
UnexpectedToken:
|
|
template: "Unexpected token '#lexeme'."
|
|
analyzerCode: UNEXPECTED_TOKEN
|
|
dart2jsCode: "*fatal*"
|
|
script:
|
|
- "import 'b.dart' d as b;"
|
|
|
|
UnmatchedToken:
|
|
template: "Can't find '#string' to match '#lexeme'."
|
|
dart2jsCode: UNMATCHED_TOKEN
|
|
script:
|
|
- "main("
|
|
- "main(){"
|
|
- "main(){[}"
|
|
|
|
UnsupportedPrefixPlus:
|
|
template: "'+' is not a prefix operator."
|
|
tip: "Try removing '+'."
|
|
dart2jsCode: UNSUPPORTED_PREFIX_PLUS
|
|
script: "main() => +2; // No longer a valid way to write '2'"
|
|
|
|
UnterminatedComment:
|
|
template: "Comment starting with '/*' must end with '*/'."
|
|
analyzerCode: UNTERMINATED_MULTI_LINE_COMMENT
|
|
dart2jsCode: UNTERMINATED_COMMENT
|
|
script:
|
|
main() {
|
|
}
|
|
/*
|
|
|
|
UnterminatedString:
|
|
template: "String starting with #string must end with #string2."
|
|
analyzerCode: UNTERMINATED_STRING_LITERAL
|
|
dart2jsCode: UNTERMINATED_STRING
|
|
script:
|
|
- >
|
|
main() {
|
|
return '
|
|
;
|
|
}
|
|
- >
|
|
main() {
|
|
return \"
|
|
;
|
|
}
|
|
- >
|
|
main() {
|
|
return r'
|
|
;
|
|
}
|
|
- >
|
|
main() {
|
|
return r\"
|
|
;
|
|
}
|
|
- >
|
|
main() => '''
|
|
- >
|
|
main() => \"\"\"
|
|
- >
|
|
main() => r'''
|
|
- >
|
|
main() => r\"\"\"
|
|
|
|
UnterminatedToken:
|
|
# This is a fall-back message that shouldn't happen.
|
|
template: "Incomplete token."
|
|
dart2jsCode: UNTERMINATED_TOKEN
|
|
|
|
Unspecified:
|
|
template: "#string"
|
|
dart2jsCode: GENERIC
|
|
|
|
AbstractNotSync:
|
|
template: "Abstract methods can't use 'async', 'async*', or 'sync*'."
|
|
dart2jsCode: "*ignored*"
|
|
|
|
AsyncAsIdentifier:
|
|
analyzerCode: ASYNC_KEYWORD_USED_AS_IDENTIFIER
|
|
template: "'async' can't be used as an identifier in 'async', 'async*', or 'sync*' methods."
|
|
dart2jsCode: GENERIC
|
|
|
|
AwaitAsIdentifier:
|
|
template: "'await' can't be used as an identifier in 'async', 'async*', or 'sync*' methods."
|
|
analyzerCode: ASYNC_KEYWORD_USED_AS_IDENTIFIER
|
|
dart2jsCode: "*ignored*"
|
|
|
|
AwaitNotAsync:
|
|
template: "'await' can only be used in 'async' or 'async*' methods."
|
|
dart2jsCode: "*ignored*"
|
|
|
|
BuiltInIdentifierAsType:
|
|
template: "The built-in identifier '#lexeme' can't be used as a type."
|
|
tip: "Try correcting the name to match an existing type."
|
|
analyzerCode: BUILT_IN_IDENTIFIER_AS_TYPE
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
|
|
BuiltInIdentifierInDeclaration:
|
|
template: "Can't use '#lexeme' as a name here."
|
|
dart2jsCode: GENERIC
|
|
|
|
AwaitForNotAsync:
|
|
template: "The asynchronous for-in can only be used in functions marked with 'async' or 'async*'."
|
|
tip: "Try marking the function body with either 'async' or 'async*', or removing the 'await' before the for loop."
|
|
analyzerCode: ASYNC_FOR_IN_WRONG_CONTEXT
|
|
dart2jsCode: "*ignored*"
|
|
script: >
|
|
main(o) sync* {
|
|
await for (var e in o) {}
|
|
}
|
|
|
|
FactoryNotSync:
|
|
template: "Factories can't use 'async', 'async*', or 'sync*'."
|
|
dart2jsCode: "*ignored*"
|
|
|
|
GeneratorReturnsValue:
|
|
template: "'sync*' and 'async*' can't return a value."
|
|
analyzerCode: RETURN_IN_GENERATOR
|
|
dart2jsCode: "*ignored*"
|
|
|
|
InvalidInlineFunctionType:
|
|
template: "Invalid inline function type."
|
|
tip: "Try changing the inline function type (as in 'int f()') to a prefixed function type using the `Function` keyword (as in 'int Function() f')."
|
|
dart2jsCode: INVALID_INLINE_FUNCTION_TYPE
|
|
declaration: "typedef F = Function(int f(String x)); main() { F f; }"
|
|
|
|
SetterNotSync:
|
|
template: "Setters can't use 'async', 'async*', or 'sync*'."
|
|
analyzerCode: INVALID_MODIFIER_ON_SETTER
|
|
dart2jsCode: "*ignored*"
|
|
|
|
YieldAsIdentifier:
|
|
template: "'yield' can't be used as an identifier in 'async', 'async*', or 'sync*' methods."
|
|
analyzerCode: ASYNC_KEYWORD_USED_AS_IDENTIFIER
|
|
dart2jsCode: "*fatal*"
|
|
|
|
YieldNotGenerator:
|
|
template: "'yield' can only be used in 'sync*' or 'async*' methods."
|
|
analyzerCode: YIELD_IN_NON_GENERATOR
|
|
dart2jsCode: "*ignored*"
|
|
|
|
OnlyTry:
|
|
template: "Try block should be followed by 'on', 'catch', or 'finally' block."
|
|
tip: "Did you forget to add a 'finally' block?"
|
|
analyzerCode: MISSING_CATCH_OR_FINALLY
|
|
dart2jsCode: "*ignored*"
|
|
statement: "try {}"
|
|
|
|
TypeAfterVar:
|
|
template: "Can't have both a type and 'var'."
|
|
tip: "Try removing 'var.'"
|
|
analyzerCode: VAR_AND_TYPE
|
|
dart2jsCode: EXTRANEOUS_MODIFIER
|
|
|
|
AssertExtraneousArgument:
|
|
template: "`assert` can't have more than two arguments."
|
|
dart2jsCode: "*fatal*"
|
|
|
|
PositionalAfterNamedArgument:
|
|
template: "Place positional arguments before named arguments."
|
|
tip: "Try moving the positional argument before the named arguments, or add a name to the argument."
|
|
analyzerCode: POSITIONAL_AFTER_NAMED_ARGUMENT
|
|
dart2jsCode: "*ignored*"
|
|
|
|
AssertAsExpression:
|
|
template: "`assert` can't be used as an expression."
|
|
dart2jsCode: "*fatal*"
|
|
|
|
FunctionTypeDefaultValue:
|
|
template: "Can't have a default value in a function type."
|
|
analyzerCode: DEFAULT_VALUE_IN_FUNCTION_TYPE
|
|
dart2jsCode: "*ignored*"
|
|
|
|
PrivateNamedParameter:
|
|
template: "An optional named parameter can't start with '_'."
|
|
dart2jsCode: "*ignored*"
|
|
|
|
NoFormals:
|
|
template: "A function should have formal parameters."
|
|
tip: "Try adding '()' after '#lexeme', or add 'get' before '#lexeme' to declare a getter."
|
|
analyzerCode: MISSING_FUNCTION_PARAMETERS
|
|
dart2jsCode: "*ignored*"
|
|
|
|
GetterWithFormals:
|
|
template: "A getter can't have formal parameters."
|
|
tip: "Try removing '(...)'."
|
|
analyzerCode: GETTER_WITH_PARAMETERS
|
|
dart2jsCode: "*ignored*"
|
|
|
|
SetterWithWrongNumberOfFormals:
|
|
template: "A setter should have exactly one formal parameter."
|
|
analyzerCode: WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
|
|
dart2jsCode: "*ignored*"
|
|
|
|
CatchSyntax:
|
|
template: "'catch' must be followed by '(identifier)' or '(identifier, identifier)'."
|
|
tip: "No types are needed, the first is given by 'on', the second is always 'StackTrace'."
|
|
dart2jsCode: "*ignored*"
|
|
|
|
SuperNullAware:
|
|
template: "'super' can't be null."
|
|
tip: "Try replacing '?.' with '.'"
|
|
analyzerCode: INVALID_OPERATOR_FOR_SUPER
|
|
dart2jsCode: "*ignored*"
|
|
|
|
ConstFieldWithoutInitializer:
|
|
template: "The const variable '#name' must be initialized."
|
|
tip: "Try adding an initializer ('= <expression>') to the declaration."
|
|
analyzerCode: CONST_NOT_INITIALIZED
|
|
dart2jsCode: "*ignored*"
|
|
|
|
FinalFieldWithoutInitializer:
|
|
template: "The final variable '#name' must be initialized."
|
|
tip: "Try adding an initializer ('= <expression>') to the declaration."
|
|
analyzerCode: FINAL_NOT_INITIALIZED
|
|
dart2jsCode: "*ignored*"
|
|
|
|
MetadataTypeArguments:
|
|
template: "An annotation (metadata) can't use type arguments."
|
|
dart2jsCode: "*ignored*"
|
|
|
|
ConstructorNotFound:
|
|
template: "Couldn't find constructor '#name'."
|
|
|
|
RedirectionTargetNotFound:
|
|
template: "Redirection constructor target not found: '#name'"
|
|
|
|
CyclicTypedef:
|
|
template: "The typedef '#name' has a reference to itself."
|
|
|
|
TypeNotFound:
|
|
template: "Type '#name' not found."
|
|
|
|
NonInstanceTypeVariableUse:
|
|
template: "Can only use type variables in instance methods."
|
|
|
|
GetterNotFound:
|
|
template: "Getter not found: '#name'."
|
|
|
|
SetterNotFound:
|
|
template: "Setter not found: '#name'."
|
|
|
|
MethodNotFound:
|
|
template: "Method not found: '#name'."
|
|
|
|
CandidateFound:
|
|
template: "Found this candidate, but the arguments don't match."
|
|
|
|
CandidateFoundIsDefaultConstructor:
|
|
template: "The class '#name' has a constructor that takes no arguments."
|
|
|
|
AbstractClassInstantiation:
|
|
template: "The class '#name' is abstract and can't be instantiated."
|
|
|
|
AbstractRedirectedClassInstantiation:
|
|
template: "Factory redirects to class '#name', which is abstract and can't be instantiated."
|
|
|
|
ListLiteralTooManyTypeArguments:
|
|
template: "Too many type arguments on List literal."
|
|
|
|
ListLiteralTypeArgumentMismatch:
|
|
template: "Map literal requires two type arguments."
|
|
|
|
LoadLibraryTakesNoArguments:
|
|
template: "'loadLibrary' takes no arguments."
|
|
|
|
LoadLibraryHidesMember:
|
|
template: "The library '#uri' defines a top-level member named 'loadLibrary'. This member is hidden by the special member 'loadLibrary' that the language adds to support deferred loading."
|
|
tip: "Try to rename or hide the member."
|
|
|
|
TypeArgumentMismatch:
|
|
# TODO(sigmund): #string should be a number instead.
|
|
template: "'#name' expects #string type arguments."
|
|
|
|
NotAType:
|
|
template: "'#name' isn't a type."
|
|
|
|
FastaUsageShort:
|
|
template: |
|
|
Frequently used options:
|
|
|
|
-o <file> Generate the output into <file>.
|
|
-h Display this message (add -v for information about all options).
|
|
|
|
FastaUsageLong:
|
|
# TODO(ahe): Consider if the reference to platform.dill needs to change below?
|
|
template: |
|
|
Supported options:
|
|
|
|
-o <file>, --output=<file>
|
|
Generate the output into <file>.
|
|
|
|
-h, /h, /?, --help
|
|
Display this message (add -v for information about all options).
|
|
|
|
-v, --verbose
|
|
Display verbose information.
|
|
|
|
--
|
|
Stop option parsing, the rest of the command line is assumed to be
|
|
file names or arguments to the Dart program.
|
|
|
|
--packages=<file>
|
|
Use package resolution configuration <file>, which should contain a mapping
|
|
of package names to paths.
|
|
|
|
--platform=<file>
|
|
Read the SDK platform from <file>, which should be in Dill/Kernel IR format
|
|
and contain the Dart SDK.
|
|
|
|
--target=none|vm|vmcc|vmreify|flutter
|
|
Specify the target configuration.
|
|
|
|
--verify
|
|
Check that the generated output is free of various problems. This is mostly
|
|
useful for developers of this compiler or Kernel transformations.
|
|
|
|
--dump-ir
|
|
Print compiled libraries in Kernel source notation.
|
|
|
|
--exclude-source
|
|
Do not include source code in the dill file.
|
|
|
|
--compile-sdk=<sdk>
|
|
Compile the SDK from scratch instead of reading it from a .dill file
|
|
(see --platform).
|
|
|
|
--sdk=<sdk>
|
|
Location of the SDK sources for use when compiling additional platform
|
|
libraries.
|
|
|
|
--fatal=errors
|
|
--fatal=warnings
|
|
--fatal=nits
|
|
Makes messages of the given kinds fatal, that is, immediately stop the
|
|
compiler with a non-zero exit-code. In --verbose mode, also display an
|
|
internal stack trace from the compiler. Multiple kinds can be separated by
|
|
commas, for example, --fatal=errors,warnings.
|
|
|
|
FastaCLIArgumentRequired:
|
|
template: "Expected value after '#name'."
|
|
|
|
NamedFunctionExpression:
|
|
template: "A function expression can't have a name."
|
|
analyzerCode: NAMED_FUNCTION_EXPRESSION
|
|
dart2jsCode: "*ignored*"
|
|
|
|
NativeClauseShouldBeAnnotation:
|
|
template: "Native clause in this form is deprecated."
|
|
tip: "Try removing this native clause and adding @native() or @native('native-name') before the declaration."
|
|
analyzerCode: NATIVE_CLAUSE_SHOULD_BE_ANNOTATION
|
|
dart2jsCode: "*fatal*"
|
|
|
|
ReturnTypeFunctionExpression:
|
|
template: "A function expression can't have a return type."
|
|
dart2jsCode: "*ignored*"
|
|
|
|
InternalProblemUnhandled:
|
|
template: "Unhandled #string in #string2."
|
|
|
|
InternalProblemUnimplemented:
|
|
template: "Unimplemented #string."
|
|
|
|
InternalProblemUnexpected:
|
|
template: "Expected '#string', but got '#string2'."
|
|
|
|
InternalProblemUnsupported:
|
|
template: "Unsupported operation: '#name'."
|
|
|
|
InternalProblemSuperclassNotFound:
|
|
template: "Superclass not found '#name'."
|
|
|
|
InternalProblemNotFound:
|
|
template: "Couldn't find '#name'."
|
|
|
|
InternalProblemNotFoundIn:
|
|
template: "Couldn't find '#name' in '#name2'."
|
|
|
|
InternalProblemPrivateConstructorAccess:
|
|
template: "Can't access private constructor '#name'."
|
|
|
|
InternalProblemConstructorNotFound:
|
|
template: "No constructor named '#name' in '#uri'."
|
|
|
|
InternalProblemExtendingUnmodifiableScope:
|
|
template: "Can't extend an unmodifiable scope."
|
|
|
|
InternalProblemPreviousTokenNotFound:
|
|
template: "Couldn't find previous token."
|
|
|
|
InternalProblemStackNotEmpty:
|
|
template: "#name.stack isn't empty:\n #string"
|
|
|
|
InternalProblemAlreadyInitialized:
|
|
template: "Attempt to set initializer on field without initializer."
|
|
|
|
InternalProblemBodyOnAbstractMethod:
|
|
template: "Attempting to set body on abstract method."
|
|
|
|
InternalProblemMissingContext:
|
|
template: "Compiler cannot run without a compiler context."
|
|
tip: "Are calls to the compiler wrapped in CompilerContext.runInContext?"
|
|
|
|
InternalProblemProvidedBothCompileSdkAndSdkSummary:
|
|
template: "The compileSdk and sdkSummary options are mutually exclusive"
|
|
|
|
InternalProblemUriMissingScheme:
|
|
template: "The URI '#uri' has no scheme."
|
|
|
|
InternalVerificationError:
|
|
template: |
|
|
Verification of the generated program failed:
|
|
#string
|
|
|
|
LocalDefinitionHidesExport:
|
|
template: "Local definition of '#name' hides export from '#uri'."
|
|
|
|
LocalDefinitionHidesImport:
|
|
template: "Local definition of '#name' hides import from '#uri'."
|
|
|
|
ExportHidesExport:
|
|
template: "Export of '#name' (from '#uri') hides export from '#uri2'."
|
|
|
|
ImportHidesImport:
|
|
template: "Import of '#name' (from '#uri') hides import from '#uri2'."
|
|
|
|
MissingPrefixInDeferredImport:
|
|
template: "Deferred imports should have a prefix."
|
|
tip: "Try adding a prefix to the import."
|
|
analyzerCode: MISSING_PREFIX_IN_DEFERRED_IMPORT
|
|
dart2jsCode: "*fatal*"
|
|
|
|
DeferredAfterPrefix:
|
|
template: "The deferred keyword should come immediately before the prefix ('as' clause)."
|
|
tip: "Try moving the deferred keyword before the prefix."
|
|
analyzerCode: DEFERRED_AFTER_PREFIX
|
|
dart2jsCode: "*fatal*"
|
|
|
|
DuplicateDeferred:
|
|
template: "An import directive can only have one 'deferred' keyword."
|
|
tip: "Try removing all but one 'deferred' keyword."
|
|
analyzerCode: DUPLICATE_DEFERRED
|
|
dart2jsCode: "*fatal*"
|
|
|
|
DuplicatePrefix:
|
|
template: "An import directive can only have one prefix ('as' clause)."
|
|
tip: "Try removing all but one prefix."
|
|
analyzerCode: DUPLICATE_PREFIX
|
|
dart2jsCode: "*fatal*"
|
|
|
|
PrefixAfterCombinator:
|
|
template: "The prefix ('as' clause) should come before any show/hide combinators."
|
|
tip: "Try moving the prefix before the combinators."
|
|
analyzerCode: PREFIX_AFTER_COMBINATOR
|
|
dart2jsCode: "*fatal*"
|
|
|
|
DuplicatedExport:
|
|
template: "'#name' is exported from both '#uri' and '#uri2'."
|
|
|
|
DuplicatedImport:
|
|
template: "'#name' is imported from both '#uri' and '#uri2'."
|
|
|
|
CyclicClassHierarchy:
|
|
template: "'#name' is a supertype of itself via '#string'."
|
|
|
|
ExtendingEnum:
|
|
template: "'#name' is an enum and can't be extended or implemented."
|
|
|
|
ExtendingRestricted:
|
|
template: "'#name' is restricted and can't be extended or implemented."
|
|
|
|
NoUnnamedConstructorInObject:
|
|
template: "'Object' has no unnamed constructor."
|
|
|
|
IllegalMixinDueToConstructors:
|
|
template: "Can't use '#name' as a mixin because it has constructors."
|
|
|
|
IllegalMixinDueToConstructorsCause:
|
|
template: "This constructor prevents using '#name' as a mixin."
|
|
|
|
ConflictsWithConstructor:
|
|
template: "Conflicts with constructor '#name'."
|
|
|
|
ConflictsWithFactory:
|
|
template: "Conflicts with factory '#name'."
|
|
|
|
ConflictsWithMember:
|
|
template: "Conflicts with member '#name'."
|
|
|
|
ConflictsWithSetter:
|
|
template: "Conflicts with setter '#name'."
|
|
|
|
ConflictsWithTypeVariable:
|
|
template: "Conflicts with type variable '#name'."
|
|
|
|
ConflictsWithTypeVariableCause:
|
|
template: "This is the type variable."
|
|
|
|
IllegalMixin:
|
|
template: "The type '#name' can't be mixed in."
|
|
|
|
OverrideTypeVariablesMismatch:
|
|
template: "Declared type variables of '#name' doesn't match those on overridden method '#name2'."
|
|
|
|
OverrideMismatchNamedParameter:
|
|
template: "The method '#name' doesn't have the named parameter '#name2' of overriden method '#name3'."
|
|
|
|
OverrideFewerNamedArguments:
|
|
template: "The method '#name' has fewer named arguments than those of overridden method '#name2'."
|
|
|
|
OverrideFewerPositionalArguments:
|
|
template: "The method '#name' has fewer positional arguments than those of overridden method '#name2'."
|
|
|
|
OverrideMoreRequiredArguments:
|
|
template: "The method '#name' has more required arguments than those of overridden method '#name2'."
|
|
|
|
IllegalMethodName:
|
|
template: "'#name' isn't a legal method name."
|
|
tip: "Did you mean '#name2'?"
|
|
|
|
ConstConstructorWithBody:
|
|
template: "A const constructor can't have a body."
|
|
|
|
PartOfSelf:
|
|
template: "A file can't be a part of itself."
|
|
|
|
TypeVariableDuplicatedName:
|
|
template: "A type variable can't have the same name as another."
|
|
|
|
TypeVariableDuplicatedNameCause:
|
|
template: "The other type variable named '#name'."
|
|
|
|
TypeVariableSameNameAsEnclosing:
|
|
template: "A type variable can't have the same name as its enclosing declaration."
|
|
|
|
EnumDeclarationEmpty:
|
|
template: "An enum declaration can't be empty."
|
|
analyzerCode: EMPTY_ENUM_BODY
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "enum E {}"
|
|
|
|
ExternalClass:
|
|
template: "Classes can't be declared to be 'external'."
|
|
tip: "Try removing the keyword 'external'."
|
|
analyzerCode: EXTERNAL_CLASS
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "external class C {}"
|
|
|
|
ExternalEnum:
|
|
template: "Enums can't be declared to be 'external'."
|
|
tip: "Try removing the keyword 'external'."
|
|
analyzerCode: EXTERNAL_ENUM
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "external enum E {ONE}"
|
|
|
|
ExternalMethodWithBody:
|
|
# TODO(danrubel): remove reference to `native` once support has been removed
|
|
template: "An external or native method can't have a body."
|
|
analyzerCode: EXTERNAL_METHOD_WITH_BODY
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "class C {external foo() {}}"
|
|
- "class C {foo() native {}}"
|
|
- "class C {foo() native 'bar' {}}"
|
|
|
|
ExternalTypedef:
|
|
template: "Typedefs can't be declared to be 'external'."
|
|
tip: "Try removing the keyword 'external'."
|
|
analyzerCode: EXTERNAL_TYPEDEF
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "external typedef F();"
|
|
|
|
OperatorWithOptionalFormals:
|
|
template: "An operator can't have optional parameters."
|
|
|
|
PlatformPrivateLibraryAccess:
|
|
template: "Can't access platform private library."
|
|
|
|
TypedefNotFunction:
|
|
template: "Can't create typedef from non-function type."
|
|
|
|
LibraryDirectiveNotFirst:
|
|
template: "The library directive must appear before all other directives."
|
|
tip: "Try moving the library directive before any other directives."
|
|
analyzerCode: LIBRARY_DIRECTIVE_NOT_FIRST
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "class Foo{} library l;"
|
|
- "import 'x.dart'; library l;"
|
|
- "part 'a.dart'; library l;"
|
|
|
|
ImportAfterPart:
|
|
template: "Import directives must preceed part directives."
|
|
tip: "Try moving the import directives before the part directives."
|
|
analyzerCode: IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "part 'foo.dart'; import 'bar.dart';"
|
|
|
|
ExportAfterPart:
|
|
template: "Export directives must preceed part directives."
|
|
tip: "Try moving the export directives before the part directives."
|
|
analyzerCode: EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "part 'foo.dart'; export 'bar.dart';"
|
|
|
|
DirectiveAfterDeclaration:
|
|
template: "Directives must appear before any declarations."
|
|
tip: "Try moving the directive before any declarations."
|
|
analyzerCode: DIRECTIVE_AFTER_DECLARATION
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "class foo { } import 'bar.dart';"
|
|
- "class foo { } export 'bar.dart';"
|
|
|
|
NonPartOfDirectiveInPart:
|
|
template: "The part-of directive must be the only directive in a part."
|
|
tip: "Try removing the other directives, or moving them to the library for which this is a part."
|
|
analyzerCode: NON_PART_OF_DIRECTIVE_IN_PART
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "part of l; part 'f.dart';"
|
|
|
|
PartOfTwice:
|
|
template: "Only one part-of directive may be declared in a file."
|
|
tip: "Try removing all but one of the part-of directives."
|
|
analyzerCode: MULTIPLE_PART_OF_DIRECTIVES
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "part of l; part of m;"
|
|
|
|
PartTwice:
|
|
template: "Can't use '#uri' as a part more than once."
|
|
|
|
FactoryTopLevelDeclaration:
|
|
template: "Top-level declarations can't be declared to be 'factory'."
|
|
tip: "Try removing the keyword 'factory'."
|
|
analyzerCode: FACTORY_TOP_LEVEL_DECLARATION
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "factory class C {}"
|
|
|
|
TopLevelOperator:
|
|
template: "Operators must be declared within a class."
|
|
tip: "Try removing the operator, moving it to a class, or converting it to be a function."
|
|
analyzerCode: TOP_LEVEL_OPERATOR
|
|
dart2jsCode: "*ignored*"
|
|
script:
|
|
- "operator +(bool x, bool y) => x | y;"
|
|
- "bool operator +(bool x, bool y) => x | y;"
|
|
- "void operator +(bool x, bool y) => x | y;"
|
|
|
|
MissingFunctionParameters:
|
|
template: "A function declaration needs an explicit list of parameters."
|
|
tip: "Try adding a parameter list to the function declaration."
|
|
analyzerCode: MISSING_FUNCTION_PARAMETERS
|
|
dart2jsCode: "*fatal*"
|
|
script:
|
|
- "void f {}"
|
|
|
|
MissingMethodParameters:
|
|
template: "A method declaration needs an explicit list of parameters."
|
|
tip: "Try adding a parameter list to the method declaration."
|
|
analyzerCode: MISSING_METHOD_PARAMETERS
|
|
dart2jsCode: "*fatal*"
|
|
script:
|
|
- "class C { void m {} }"
|
|
|
|
MissingTypedefParameters:
|
|
template: "A typedef needs an explicit list of parameters."
|
|
tip: "Try adding a parameter list to the typedef."
|
|
analyzerCode: MISSING_TYPEDEF_PARAMETERS
|
|
dart2jsCode: "*fatal*"
|
|
script:
|
|
- "typedef void F;"
|
|
|
|
MissingPartOf:
|
|
template: "Can't use '#uri' as a part, because it has no 'part of' declaration."
|
|
|
|
SupertypeIsFunction:
|
|
template: "Can't use a function type as supertype."
|
|
|
|
DeferredPrefixDuplicated:
|
|
template: "Can't use the name '#name' for a deferred library, as the name is used elsewhere."
|
|
|
|
DeferredPrefixDuplicatedCause:
|
|
template: "'#name' is used here."
|
|
|
|
TypeArgumentsOnTypeVariable:
|
|
template: "Can't use type arguments with type variable '#name'."
|
|
|
|
DuplicatedDefinition:
|
|
template: "Duplicated definition of '#name'."
|
|
|
|
DuplicatedName:
|
|
template: "Duplicated name: '#name'."
|
|
|
|
DuplicatedParameterName:
|
|
template: "Duplicated parameter name '#name'."
|
|
|
|
DuplicatedParameterNameCause:
|
|
template: "Other parameter named '#name'."
|
|
|
|
MemberWithSameNameAsClass:
|
|
template: "A class member can't have the same name as the enclosing class."
|
|
|
|
EnumConstantSameNameAsEnclosing:
|
|
template: "Name of enum constant '#name' can't be the same as the enum's own name."
|
|
|
|
MissingOperatorKeyword:
|
|
template: "Operator declarations must be preceeded by the keyword 'operator'."
|
|
tip: "Try adding the keyword 'operator'."
|
|
analyzerCode: MISSING_KEYWORD_OPERATOR
|
|
dart2jsCode: "*fatal*"
|
|
script:
|
|
- "class C { +(x) {} }"
|
|
|
|
InvalidOperator:
|
|
template: "The string '#lexeme' isn't a user-definable operator."
|
|
analyzerCode: INVALID_OPERATOR
|
|
dart2jsCode: "*fatal*"
|
|
script:
|
|
- "class C { void operator ===(x) {} }"
|
|
|
|
OperatorParameterMismatch0:
|
|
template: "Operator '#name' shouldn't have any parameters."
|
|
|
|
OperatorParameterMismatch1:
|
|
template: "Operator '#name' should have exactly one parameter."
|
|
|
|
OperatorParameterMismatch2:
|
|
template: "Operator '#name' should have exactly two parameters."
|
|
|
|
OperatorMinusParameterMismatch:
|
|
template: "Operator '#name' should have zero or one parameter."
|
|
tip: >-
|
|
With zero parameters, it has the syntactic form '-a', formally known as 'unary-'.
|
|
With one parameter, it has the syntactic form 'a - b', formally known as '-'.
|
|
|
|
SupertypeIsIllegal:
|
|
template: "The type '#name' can't be used as supertype."
|
|
|
|
SupertypeIsTypeVariable:
|
|
template: "The type variable '#name' can't be used as supertype."
|
|
|
|
PartOfLibraryNameMismatch:
|
|
template: "Using '#uri' as part of '#name' but its 'part of' declaration says '#name2'."
|
|
|
|
PartOfUseUri:
|
|
template: "Using '#uri' as part of '#uri2' but its 'part of' declaration says '#name'."
|
|
tip: "Try changing the 'part of' declaration to use a relative file name."
|
|
|
|
PartOfUriMismatch:
|
|
template: "Using '#uri' as part of '#uri2' but its 'part of' declaration says '#uri3'."
|
|
|
|
MissingMain:
|
|
template: "No 'main' method found."
|
|
tip: "Try adding a method named 'main' to your program."
|
|
dart2jsCode: MISSING_MAIN
|
|
|
|
MissingInput:
|
|
template: "No input file provided to the compiler."
|
|
|
|
InputFileNotFound:
|
|
template: "Input file not found: #uri."
|
|
|
|
SdkRootNotFound:
|
|
template: "SDK root directory not found: #uri."
|
|
|
|
SdkSummaryNotFound:
|
|
template: "SDK summary not found: #uri."
|
|
|
|
SdkSpecificationNotFound:
|
|
template: "SDK libraries specification not found: #uri."
|
|
tip: "Normally, the specification is a file named 'libraries.json' in the Dart SDK install location."
|
|
|
|
ThisAccessInFieldInitializer:
|
|
template: "Can't access 'this' in a field initializer to read '#name'."
|
|
|
|
ThisAsIdentifier:
|
|
template: "Expected identifier, but got 'this'."
|
|
|
|
SuperAsIdentifier:
|
|
template: "Expected identifier, but got 'super'."
|
|
|
|
SuperAsExpression:
|
|
template: "Super calls can't be used as expressions."
|
|
tip: "To delegate a constructor to a super constructor, put the super call as an initializer."
|
|
|
|
SwitchCaseFallThrough:
|
|
template: "Switch case may fall through to the next case."
|
|
|
|
FinalInstanceVariableAlreadyInitialized:
|
|
template: "'#name' is a final instance variable that has already been initialized."
|
|
|
|
FinalInstanceVariableAlreadyInitializedCause:
|
|
template: "'#name' was initialized here."
|
|
|
|
TypeVariableInStaticContext:
|
|
template: "Type variables can't be used in static members."
|
|
|
|
SuperclassMethodArgumentMismatch:
|
|
template: "Superclass doesn't have a method named '#name' with matching arguments."
|
|
|
|
SuperclassHasNoGetter:
|
|
template: "Superclass has no getter named '#name'."
|
|
|
|
SuperclassHasNoSetter:
|
|
template: "Superclass has no setter named '#name'."
|
|
|
|
SuperclassHasNoMethod:
|
|
template: "Superclass has no method named '#name'."
|
|
|
|
SuperclassHasNoDefaultConstructor:
|
|
template: "The superclass, '#name', has no unnamed constructor that takes no arguments."
|
|
|
|
ConstConstructorNonFinalField:
|
|
template: "Constructor is marked 'const' so all fields must be final."
|
|
|
|
ConstConstructorNonFinalFieldCause:
|
|
template: "Field isn't final, but constructor is 'const'."
|
|
|
|
AccessError:
|
|
template: "Access error: '#name'."
|
|
|
|
PreviousUseOfName:
|
|
template: "Previous use of '#name'."
|
|
|
|
ExpressionNotMetadata:
|
|
template: "This can't be used as metadata; metadata should be a reference to a compile-time constant variable, or a call to a constant constructor."
|
|
|
|
AnnotationOnEnumConstant:
|
|
template: "Enum constants can't have annotations."
|
|
tip: "Try removing the annotation."
|
|
analyzerCode: ANNOTATION_ON_ENUM_CONSTANT
|
|
dart2jsCode: "*fatal*"
|
|
|
|
ExpectedAnInitializer:
|
|
template: "Expected an initializer."
|
|
|
|
NotAnLvalue:
|
|
template: "Can't assign to this."
|
|
|
|
CannotReadPackagesFile:
|
|
template: "Unable to read '.packages' file:\n #string."
|
|
|
|
CannotReadSdkSpecification:
|
|
template: "Unable to read the 'libraries.json' specification file:\n #string."
|
|
|
|
CantInferPackagesFromManyInputs:
|
|
template: "Can't infer a .packages file when compiling multiple inputs."
|
|
tip: "Try specifying the file explicitly with the --packages option."
|
|
|
|
CantInferPackagesFromPackageUri:
|
|
template: "Can't infer a .packages file from an input 'package:*' URI."
|
|
tip: "Try specifying the file explicitly with the --packages option."
|
|
|
|
PackageNotFound:
|
|
template: "Could not resolve the package '#name' in '#uri'."
|
|
|
|
InvalidPackageUri:
|
|
template: "Invalid package URI '#uri':\n #string."
|
|
|
|
CouldNotParseUri:
|
|
template: "Couldn't parse URI '#string':\n #string2."
|
|
|
|
ExpectedUri:
|
|
template: "Expected a URI."
|
|
|
|
InterpolationInUri:
|
|
template: "Can't use string interpolation in a URI."
|
|
|
|
IntegerLiteralIsOutOfRange:
|
|
template: "The integer literal #lexeme can't be represented in 64 bits."
|
|
tip: "Try using BigInt (from 'dart:typed_data' library) if you need an integer larger than 9,223,372,036,854,775,807 or less than -9,223,372,036,854,775,808."
|
|
|
|
ColonInPlaceOfIn:
|
|
template: "For-in loops use 'in' rather than a colon."
|
|
tip: "Try replacing the colon with the keyword 'in'."
|
|
analyzerCode: COLON_IN_PLACE_OF_IN
|
|
dart2jsCode: "*fatal*"
|
|
|
|
ExternalFactoryRedirection:
|
|
template: "A redirecting factory can't be external."
|
|
tip: "Try removing the 'external' modifier."
|
|
analyzerCode: EXTERNAL_CONSTRUCTOR_WITH_BODY
|
|
dart2jsCode: "*ignored*"
|
|
|
|
InvalidAssignment:
|
|
template: "A value of type '#type' can't be assigned to a variable of type '#type2'."
|
|
tip: "Try changing the type of the left hand side, or casting the right hand side to '#type2'."
|
|
analyzerCode: INVALID_ASSIGNMENT
|
|
dart2jsCode: "*ignored*"
|
|
script: >
|
|
main() {
|
|
int i;
|
|
i = 1.5;
|
|
}
|
|
|
|
PatchClassTypeVariablesMismatch:
|
|
template: "A patch class must have the same number of type variables as its origin class."
|
|
|
|
PatchClassOrigin:
|
|
template: "This is the origin class."
|
|
|
|
PatchDeclarationMismatch:
|
|
template: "This patch doesn't match origin declaration."
|
|
|
|
PatchDeclarationOrigin:
|
|
template: "This is the origin declaration."
|
|
|
|
PatchInjectionFailed:
|
|
template: "Can't inject '#name' into '#uri'."
|
|
tip: "Try adding '@patch'."
|
|
|
|
PatchNonExternal:
|
|
template: "Can't apply this patch as its origin declaration isn't external."
|
|
tip: "Try adding 'external' to the origin declaration."
|
|
|