Version 3.10.0-204.0.dev Merge 827551f8e0bb2284e93b698257d58563eb36c535 into dev
diff --git a/pkg/_fe_analyzer_shared/messages.yaml b/pkg/_fe_analyzer_shared/messages.yaml new file mode 100644 index 0000000..32a0826 --- /dev/null +++ b/pkg/_fe_analyzer_shared/messages.yaml
@@ -0,0 +1,2238 @@ +# 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. + +# This file contains error messages that are shared between the analyzer and the +# front end. + +# See pkg/front_end/messages.yaml for documentation about this file. + +# Currently, the code generation logic uses the presence of an `index` entry to +# determine whether a given error message should be generated into both the +# analyzer and the front end, so all error messages in this file should have a +# non-null `index`. +# TODO(paulberry): remove the need for the `index` field. + +ExperimentNotEnabled: + parameters: + String string: undocumented + String string2: undocumented + index: 48 + problemMessage: "This requires the '#string' language feature to be enabled." + correctionMessage: "Try updating your pubspec.yaml to set the minimum SDK constraint to #string2 or higher, and running 'pub get'." + analyzerCode: ParserErrorCode.EXPERIMENT_NOT_ENABLED + +ExperimentNotEnabledOffByDefault: + parameters: + String string: undocumented + index: 133 + problemMessage: "This requires the experimental '#string' language feature to be enabled." + correctionMessage: "Try passing the '--enable-experiment=#string' command line option." + analyzerCode: ParserErrorCode.EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT + script: | + // @dart=3.5 + void foo() { + int i = 42_42_42_42; + } + +RecordLiteralOnePositionalFieldNoTrailingComma: + parameters: none + problemMessage: "A record literal with exactly one positional field requires a trailing comma." + correctionMessage: "Try adding a trailing comma." + analyzerCode: ParserErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA + index: 127 + hasPublishedDocs: true + documentation: |- + #### Description + + The analyzer produces this diagnostic when a record literal with a single + positional field doesn't have a trailing comma after the field. + + In some locations a record literal with a single positional field could + also be a parenthesized expression. A trailing comma is required to + disambiguate these two valid interpretations. + + #### Example + + The following code produces this diagnostic because the record literal has + one positional field but doesn't have a trailing comma: + + ```dart + var r = const (1[!)!]; + ``` + + #### Common fixes + + Add a trailing comma: + + ```dart + var r = const (1,); + ``` + script: | + main() { + var record = const (1); + } + +RecordLiteralZeroFieldsWithTrailingComma: + parameters: none + problemMessage: "A record literal without fields can't have a trailing comma." + correctionMessage: "Try removing the trailing comma." + analyzerCode: ParserErrorCode.EMPTY_RECORD_LITERAL_WITH_COMMA + index: 128 + hasPublishedDocs: true + documentation: |- + #### Description + + The analyzer produces this diagnostic when a record literal that has no + fields has a trailing comma. Empty record literals can't contain a comma. + + #### Example + + The following code produces this diagnostic because the empty record + literal has a trailing comma: + + ```dart + var r = ([!,!]); + ``` + + #### Common fixes + + If the record is intended to be empty, then remove the comma: + + ```dart + var r = (); + ``` + + If the record is intended to have one or more fields, then add the + expressions used to compute the values of those fields: + + ```dart + var r = (3, 4); + ``` + script: | + main() { + var record = (,); + } + +EmptyRecordTypeNamedFieldsList: + parameters: none + problemMessage: "The list of named fields in a record type can't be empty." + correctionMessage: "Try adding a named field to the list." + analyzerCode: ParserErrorCode.EMPTY_RECORD_TYPE_NAMED_FIELDS_LIST + index: 129 + hasPublishedDocs: true + documentation: |- + #### Description + + The analyzer produces this diagnostic when a record type has an empty list + of named fields. + + #### Example + + The following code produces this diagnostic because the record type has an + empty list of named fields: + + ```dart + void f((int, int, {[!}!]) r) {} + ``` + + #### Common fixes + + If the record is intended to have named fields, then add the types and + names of the fields: + + ```dart + void f((int, int, {int z}) r) {} + ``` + + If the record isn't intended to have named fields, then remove the curly + braces: + + ```dart + void f((int, int) r) {} + ``` + script: | + main() { + (int, int, {/*missing*/}) record = (1, 2,); + } + +RecordTypeZeroFieldsButTrailingComma: + parameters: none + problemMessage: "A record type without fields can't have a trailing comma." + correctionMessage: "Try removing the trailing comma." + analyzerCode: ParserErrorCode.EMPTY_RECORD_TYPE_WITH_COMMA + index: 130 + hasPublishedDocs: true + documentation: |- + #### Description + + The analyzer produces this diagnostic when a record type that has no + fields has a trailing comma. Empty record types can't contain a comma. + + #### Example + + The following code produces this diagnostic because the empty record type + has a trailing comma: + + ```dart + void f(([!,!]) r) {} + ``` + + #### Common fixes + + If the record type is intended to be empty, then remove the comma: + + ```dart + void f(() r) {} + ``` + + If the record type is intended to have one or more fields, then add the + types of those fields: + + ```dart + void f((int, int) r) {} + ``` + script: | + main() { + (,) record = (); + } + +RecordTypeOnePositionalFieldNoTrailingComma: + parameters: none + problemMessage: "A record type with exactly one positional field requires a trailing comma." + correctionMessage: "Try adding a trailing comma." + analyzerCode: ParserErrorCode.RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA + index: 131 + hasPublishedDocs: true + documentation: |- + #### Description + + The analyzer produces this diagnostic when a record type annotation with a + single positional field doesn't have a trailing comma after the field. + + In some locations a record type with a single positional field could also + be a parenthesized expression. A trailing comma is required to + disambiguate these two valid interpretations. + + #### Example + + The following code produces this diagnostic because the record type has + one positional field, but doesn't have a trailing comma: + + ```dart + void f((int[!)!] r) {} + ``` + + #### Common fixes + + Add a trailing comma: + + ```dart + void f((int,) r) {} + ``` + script: | + main() { + (int /* missing trailing comma */) record = const (1, ); + } + +ExpectedElseOrComma: + parameters: none + index: 46 + problemMessage: "Expected 'else' or comma." + analyzerCode: ParserErrorCode.EXPECTED_ELSE_OR_COMMA + script: | + void foo(int i) { + var x = [ + if (i > 2) 2 + 2 + ]; + } + +ExpectedStatement: + parameters: none + index: 29 + problemMessage: "Expected a statement." + analyzerCode: ParserErrorCode.MISSING_STATEMENT + statement: "void;" + +ExpectedInstead: + parameters: + String string: undocumented + index: 41 + problemMessage: "Expected '#string' instead of this." + # This is an alternative to ExpectedButGot when the last consumed token + # should be replaced with a different token. + # + # For example, this is ok... + # + # mixin Foo extends Bar { + # ^^^^^^^ + # Expected 'on' before this + # + # but this is easier for the user... + # + # mixin Foo extends Bar { + # ^^^^^^^ + # Expected 'on' instead of this + # + analyzerCode: ParserErrorCode.EXPECTED_INSTEAD + script: + - "class B {} mixin A extends B { }" + +MultipleLibraryDirectives: + parameters: none + index: 27 + problemMessage: "Only one library directive may be declared in a file." + correctionMessage: "Try removing all but one of the library directives." + analyzerCode: ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES + script: + library foo; + library bar; + +MultipleExtends: + parameters: none + index: 28 + problemMessage: "Each class definition can have at most one extends clause." + correctionMessage: "Try choosing one superclass and define your class to implement (or mix in) the others." + analyzerCode: ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES + script: + - "class B{} class C{} class A extends B extends C {}" + - "class B{} class C{} class A extends B, C {}" + +MultipleWith: + parameters: none + index: 24 + problemMessage: "Each class definition can have at most one with clause." + correctionMessage: "Try combining all of the with clauses into a single clause." + analyzerCode: ParserErrorCode.MULTIPLE_WITH_CLAUSES + script: "class A extends B with C, D with E {}" + exampleAllowOtherCodes: true + +WithBeforeExtends: + parameters: none + index: 11 + problemMessage: "The extends clause must be before the with clause." + correctionMessage: "Try moving the extends clause before the with clause." + analyzerCode: ParserErrorCode.WITH_BEFORE_EXTENDS + script: "mixin B {} class C {} class A with B extends C {}" + +ImplementsBeforeExtends: + parameters: none + index: 44 + problemMessage: "The extends clause must be before the implements clause." + correctionMessage: "Try moving the extends clause before the implements clause." + analyzerCode: ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS + script: "class A implements B extends C {}" + exampleAllowOtherCodes: true + +ImplementsBeforeOn: + parameters: none + index: 43 + problemMessage: "The on clause must be before the implements clause." + correctionMessage: "Try moving the on clause before the implements clause." + analyzerCode: ParserErrorCode.IMPLEMENTS_BEFORE_ON + script: "mixin A implements B on C {}" + exampleAllowOtherCodes: true + +ImplementsBeforeWith: + parameters: none + index: 42 + problemMessage: "The with clause must be before the implements clause." + correctionMessage: "Try moving the with clause before the implements clause." + analyzerCode: ParserErrorCode.IMPLEMENTS_BEFORE_WITH + script: "class A extends B implements C with D {}" + exampleAllowOtherCodes: true + +MultipleClauses: + parameters: + String string: undocumented + String string2: undocumented + problemMessage: "Each '#string' definition can have at most one '#string2' clause." + correctionMessage: "Try combining all of the '#string2' clauses into a single clause." + analyzerCode: ParserErrorCode.MULTIPLE_CLAUSES + index: 121 + script: + - "mixin B {} enum A implements B implements C, D { v; }" + - "mixin B {} enum A with B with C, D { v; }" + +OutOfOrderClauses: + parameters: + String string: undocumented + String string2: undocumented + problemMessage: "The '#string' clause must come before the '#string2' clause." + correctionMessage: "Try moving the '#string' clause before the '#string2' clause." + analyzerCode: ParserErrorCode.OUT_OF_ORDER_CLAUSES + index: 122 + script: "class B {} class D {} enum A implements B with D { v; }" + +MultipleOnClauses: + parameters: none + index: 26 + problemMessage: "Each mixin definition can have at most one on clause." + correctionMessage: "Try combining all of the on clauses into a single clause." + analyzerCode: ParserErrorCode.MULTIPLE_ON_CLAUSES + script: "mixin A on B on C, D {}" + exampleAllowOtherCodes: true + +MixinWithClause: + parameters: none + index: 154 + problemMessage: "A mixin can't have a with clause." + analyzerCode: ParserErrorCode.MIXIN_WITH_CLAUSE + script: "mixin M {} mixin N with M {}" + +ExpectedClassBody: + parameters: none + index: 8 + problemMessage: "A class declaration must have a body, even if it is empty." + correctionMessage: "Try adding an empty body." + analyzerCode: ParserErrorCode.EXPECTED_CLASS_BODY + sharedName: EXPECTED_BODY + script: | + class Class + +ExpectedMixinBody: + parameters: none + index: 166 + problemMessage: "A mixin declaration must have a body, even if it is empty." + correctionMessage: "Try adding an empty body." + analyzerCode: ParserErrorCode.EXPECTED_MIXIN_BODY + sharedName: EXPECTED_BODY + script: | + mixin Mixin + +ExpectedExtensionBody: + parameters: none + index: 173 + problemMessage: "An extension declaration must have a body, even if it is empty." + correctionMessage: "Try adding an empty body." + analyzerCode: ParserErrorCode.EXPECTED_EXTENSION_BODY + sharedName: EXPECTED_BODY + script: | + extension Extension on int + +ExpectedExtensionTypeBody: + parameters: none + index: 167 + problemMessage: "An extension type declaration must have a body, even if it is empty." + correctionMessage: "Try adding an empty body." + analyzerCode: ParserErrorCode.EXPECTED_EXTENSION_TYPE_BODY + sharedName: EXPECTED_BODY + script: | + extension type ExtensionType(int i) + +ExpectedTryStatementBody: + parameters: none + index: 168 + problemMessage: "A try statement must have a body, even if it is empty." + correctionMessage: "Try adding an empty body." + analyzerCode: ParserErrorCode.EXPECTED_TRY_STATEMENT_BODY + sharedName: EXPECTED_BODY + script: | + method() { + try finally {} + } + +ExpectedCatchClauseBody: + parameters: none + index: 169 + problemMessage: "A catch clause must have a body, even if it is empty." + correctionMessage: "Try adding an empty body." + analyzerCode: ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY + sharedName: EXPECTED_BODY + script: | + method() { + try {} catch (_); + } + +ExpectedFinallyClauseBody: + parameters: none + index: 170 + problemMessage: "A finally clause must have a body, even if it is empty." + correctionMessage: "Try adding an empty body." + analyzerCode: ParserErrorCode.EXPECTED_FINALLY_CLAUSE_BODY + sharedName: EXPECTED_BODY + script: | + method() { + try {} finally; + } + +ExpectedSwitchExpressionBody: + parameters: none + index: 171 + problemMessage: "A switch expression must have a body, even if it is empty." + correctionMessage: "Try adding an empty body." + analyzerCode: ParserErrorCode.EXPECTED_SWITCH_EXPRESSION_BODY + sharedName: EXPECTED_BODY + script: | + method(Never n) => switch (n); + +ExpectedSwitchStatementBody: + parameters: none + index: 172 + problemMessage: "A switch statement must have a body, even if it is empty." + correctionMessage: "Try adding an empty body." + analyzerCode: ParserErrorCode.EXPECTED_SWITCH_STATEMENT_BODY + sharedName: EXPECTED_BODY + script: | + method(Never n) { + switch (n); + } + +ExpectedIdentifierButGotKeyword: + parameters: + Token lexeme: undocumented + problemMessage: "'#lexeme' can't be used as an identifier because it's a keyword." + correctionMessage: "Try renaming this to be an identifier that isn't a keyword." + index: 113 + analyzerCode: ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD + script: "var default = 42;" + +EqualityCannotBeEqualityOperand: + parameters: none + index: 1 + problemMessage: "A comparison expression can't be an operand of another comparison expression." + correctionMessage: "Try putting parentheses around one of the comparisons." + analyzerCode: ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND + exampleAllowOtherCodes: true + script: + - "main() { var b = a < b < c; }" + - "main() { var b = a == b != c; }" + +VarAsTypeName: + parameters: none + index: 61 + problemMessage: "The keyword 'var' can't be used as a type name." + analyzerCode: ParserErrorCode.VAR_AS_TYPE_NAME + script: + - "class A { Map<String, var> m; }" + exampleAllowOtherCodes: true + +MissingExpressionInThrow: + parameters: none + index: 32 + problemMessage: "Missing expression after 'throw'." + correctionMessage: "Add an expression after 'throw' or use 'rethrow' to throw a caught exception" + analyzerCode: ParserErrorCode.MISSING_EXPRESSION_IN_THROW + statement: + - "throw;" + +MissingConstFinalVarOrType: + parameters: none + index: 33 + problemMessage: "Variables must be declared using the keywords 'const', 'final', 'var' or a type name." + correctionMessage: "Try adding the name of the type of the variable or the keyword 'var'." + analyzerCode: ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE + script: + - "class C { static f; }" + +FunctionTypedParameterVar: + parameters: none + index: 119 + problemMessage: "Function-typed parameters can't specify 'const', 'final' or 'var' in place of a return type." + correctionMessage: "Try replacing the keyword with a return type." + analyzerCode: ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR + script: + - "void f(const x()) {}" + - "void f(final x()) {}" + - "void f(var x()) {}" + exampleAllowOtherCodes: true + +AbstractClassMember: + parameters: none + index: 51 + problemMessage: "Members of classes can't be declared to be 'abstract'." + correctionMessage: "Try removing the 'abstract' keyword. You can add the 'abstract' keyword before the class declaration." + analyzerCode: ParserErrorCode.ABSTRACT_CLASS_MEMBER + 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);} + +AbstractExternalField: + parameters: none + index: 110 + problemMessage: "Fields can't be declared both 'abstract' and 'external'." + analyzerCode: ParserErrorCode.ABSTRACT_EXTERNAL_FIELD + correctionMessage: "Try removing the 'abstract' or 'external' keyword." + script: + - "abstract class C {abstract external var f;}" + - "abstract class C {external abstract var f;}" + +AbstractStaticField: + parameters: none + index: 107 + problemMessage: "Static fields can't be declared 'abstract'." + analyzerCode: ParserErrorCode.ABSTRACT_STATIC_FIELD + correctionMessage: "Try removing the 'abstract' or 'static' keyword." + script: + - "abstract class C {abstract static var f;}" + +AbstractLateField: + parameters: none + index: 108 + problemMessage: "Abstract fields cannot be late." + analyzerCode: ParserErrorCode.ABSTRACT_LATE_FIELD + correctionMessage: "Try removing the 'abstract' or 'late' keyword." + script: + - "abstract class C {abstract late var f;}" + +AbstractFinalBaseClass: + parameters: none + problemMessage: "An 'abstract' class can't be declared as both 'final' and 'base'." + correctionMessage: "Try removing either the 'final' or 'base' keyword." + analyzerCode: ParserErrorCode.ABSTRACT_FINAL_BASE_CLASS + index: 176 + script: + - "abstract final base class C {}" + +AbstractFinalInterfaceClass: + parameters: none + problemMessage: "An 'abstract' class can't be declared as both 'final' and 'interface'." + correctionMessage: "Try removing either the 'final' or 'interface' keyword." + analyzerCode: ParserErrorCode.ABSTRACT_FINAL_INTERFACE_CLASS + index: 50 + script: + - "abstract final interface class C {}" + +AbstractSealedClass: + parameters: none + problemMessage: "A 'sealed' class can't be marked 'abstract' because it's already implicitly abstract." + correctionMessage: "Try removing the 'abstract' keyword." + analyzerCode: ParserErrorCode.ABSTRACT_SEALED_CLASS + index: 132 + hasPublishedDocs: true + documentation: |- + #### Description + + The analyzer produces this diagnostic when a class is declared using both + the modifier `abstract` and the modifier `sealed`. Sealed classes are + implicitly abstract, so explicitly using both modifiers is not allowed. + + #### Example + + The following code produces this diagnostic because the class `C` is + declared using both `abstract` and `sealed`: + + ```dart + abstract [!sealed!] class C {} + ``` + + #### Common fixes + + If the class should be abstract but not sealed, then remove the `sealed` + modifier: + + ```dart + abstract class C {} + ``` + + If the class should be both abstract and sealed, then remove the + `abstract` modifier: + + ```dart + sealed class C {} + ``` + script: + - "sealed abstract class C {}" + - "abstract sealed class C {}" + +ClassInClass: + parameters: none + index: 53 + problemMessage: "Classes can't be declared inside other classes." + correctionMessage: "Try moving the class to the top-level." + analyzerCode: ParserErrorCode.CLASS_IN_CLASS + script: + - "class C { class B {} }" + +EnumInClass: + parameters: none + index: 74 + problemMessage: "Enums can't be declared inside classes." + correctionMessage: "Try moving the enum to the top-level." + analyzerCode: ParserErrorCode.ENUM_IN_CLASS + script: + - "class Foo { enum Bar { Bar1, Bar2, Bar3 } }" + +TypedefInClass: + parameters: none + index: 7 + problemMessage: "Typedefs can't be declared inside classes." + correctionMessage: "Try moving the typedef to the top-level." + analyzerCode: ParserErrorCode.TYPEDEF_IN_CLASS + script: + - "abstract class C { typedef int F(int x); }" + +CovariantMember: + parameters: none + index: 67 + problemMessage: "Getters, setters and methods can't be declared to be 'covariant'." + correctionMessage: "Try removing the 'covariant' keyword." + analyzerCode: ParserErrorCode.COVARIANT_MEMBER + script: + - "class A { covariant get x => 0; }" + - "class A { covariant int m() => 0; }" + +VarReturnType: + parameters: none + index: 12 + problemMessage: "The return type can't be 'var'." + correctionMessage: "Try removing the keyword 'var', or replacing it with the name of the return type." + analyzerCode: ParserErrorCode.VAR_RETURN_TYPE + script: + - "class C { var m() {} }" + - "class C { var C() {} }" + +ConstClass: + parameters: none + index: 60 + problemMessage: "Classes can't be declared to be 'const'." + correctionMessage: "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: ParserErrorCode.CONST_CLASS + script: "const class C {}" + +ConstAndFinal: + parameters: none + index: 58 + problemMessage: "Members can't be declared to be both 'const' and 'final'." + correctionMessage: "Try removing either the 'const' or 'final' keyword." + analyzerCode: ParserErrorCode.CONST_AND_FINAL + declaration: + - "class C { static const final int x = 5; }" + - "class C { static final const int x = 5; }" + - "const final int x = 5;" + - "final const int x = 5;" + +ConflictingModifiers: + parameters: + String string: undocumented + String string2: undocumented + index: 59 + problemMessage: "Members can't be declared to be both '#string' and '#string2'." + correctionMessage: "Try removing one of the keywords." + analyzerCode: ParserErrorCode.CONFLICTING_MODIFIERS + script: + - "class C { const var x; }" + - "class C { var const x; }" + exampleAllowOtherCodes: true + +ConstFactory: + parameters: none + index: 62 + problemMessage: "Only redirecting factory constructors can be declared to be 'const'." + correctionMessage: "Try removing the 'const' keyword, or replacing the body with '=' followed by a valid target." + analyzerCode: ParserErrorCode.CONST_FACTORY + script: | + class C { + const factory C() => const C.internal(); + const C.internal(); + } + +ModifierOutOfOrder: + parameters: + String string: undocumented + String string2: undocumented + index: 56 + problemMessage: "The modifier '#string' should be before the modifier '#string2'." + correctionMessage: "Try re-ordering the modifiers." + analyzerCode: ParserErrorCode.MODIFIER_OUT_OF_ORDER + script: + - "class C { factory const C() = prefix.B.foo; }" + - "class C { factory external C(); }" + - "class C { const external C(); }" + - "class C { static external f(); }" + - "class C { final static int f = 5; }" + - "class C { var static f; }" + - "var external foo; main(){}" + exampleAllowOtherCodes: true + +TypeBeforeFactory: + parameters: none + index: 57 + problemMessage: "Factory constructors cannot have a return type." + correctionMessage: "Try removing the type appearing before 'factory'." + analyzerCode: ParserErrorCode.TYPE_BEFORE_FACTORY + script: | + class C { + T factory C() { return new C.constructor(); } + C.constructor(); + } + +ConstMethod: + parameters: none + index: 63 + problemMessage: "Getters, setters and methods can't be declared to be 'const'." + correctionMessage: "Try removing the 'const' keyword." + analyzerCode: ParserErrorCode.CONST_METHOD + script: + - "class C { const m() {} }" + +CovariantAndStatic: + parameters: none + index: 66 + problemMessage: "Members can't be declared to be both 'covariant' and 'static'." + correctionMessage: "Try removing either the 'covariant' or 'static' keyword." + analyzerCode: ParserErrorCode.COVARIANT_AND_STATIC + script: + - "class A {} class C { covariant static A? f; }" + - "class A {} class C { static covariant A? f; }" + +DuplicatedModifier: + parameters: + Token lexeme: undocumented + index: 70 + problemMessage: "The modifier '#lexeme' was already specified." + correctionMessage: "Try removing all but one occurrence of the modifier." + analyzerCode: ParserErrorCode.DUPLICATED_MODIFIER + comment: |- + Parameters: + 0: the modifier that was duplicated + exampleAllowOtherCodes: true + script: + - "class C { const const m; }" + - "class C { external external f(); }" + - "class C { final final m = 5; }" + - "class C { static static var m; }" + - "class C { var var m; }" + +ExternalConstructorWithFieldInitializers: + parameters: none + index: 87 + problemMessage: "An external constructor can't initialize fields." + correctionMessage: "Try removing the field initializers, or removing the keyword 'external'." + analyzerCode: ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_FIELD_INITIALIZERS + script: | + class Foo { + var x = -1; + external Foo.x(this.x); + } + +ExternalFactoryWithBody: + parameters: none + index: 86 + problemMessage: "External factories can't have a body." + correctionMessage: "Try removing the body of the factory, or removing the keyword 'external'." + analyzerCode: ParserErrorCode.EXTERNAL_FACTORY_WITH_BODY + script: + - "class C { external factory C() {} }" + exampleAllowOtherCodes: true + +ExternalLateField: + parameters: none + index: 109 + problemMessage: "External fields cannot be late." + analyzerCode: ParserErrorCode.EXTERNAL_LATE_FIELD + correctionMessage: "Try removing the 'external' or 'late' keyword." + script: + - "external late var f;" + - "abstract class C {external late var f;}" + +ExtraneousModifier: + parameters: + Token lexeme: undocumented + index: 77 + problemMessage: "Can't have modifier '#lexeme' here." + correctionMessage: "Try removing '#lexeme'." + analyzerCode: ParserErrorCode.EXTRANEOUS_MODIFIER + script: + - "var abstract foo; main(){}" + - "var static foo; main(){}" + - "abstract var foo; main(){}" + - "static var foo; main(){}" + - "abstract foo; main(){}" + - "static foo; main(){}" + - "abstract enum foo {bar}" + - "abstract void foo() {}" + - "static void foo() {}" + - "abstract typedef foo();" + - "static typedef foo();" + exampleAllowOtherCodes: true + +ExtraneousModifierInExtension: + parameters: + Token lexeme: undocumented + index: 98 + problemMessage: "Can't have modifier '#lexeme' in an extension." + correctionMessage: "Try removing '#lexeme'." + analyzerCode: ParserErrorCode.INVALID_USE_OF_COVARIANT_IN_EXTENSION + hasPublishedDocs: true + comment: No parameters. + documentation: |- + #### Description + + The analyzer produces this diagnostic when a member declared inside an + extension uses the keyword `covariant` in the declaration of a parameter. + Extensions aren't classes and don't have subclasses, so the keyword serves + no purpose. + + #### Example + + The following code produces this diagnostic because `i` is marked as being + covariant: + + ```dart + extension E on String { + void a([!covariant!] int i) {} + } + ``` + + #### Common fixes + + Remove the `covariant` keyword: + + ```dart + extension E on String { + void a(int i) {} + } + ``` + script: + - "extension on String { foo(covariant String child) {} }" + +ExtraneousModifierInExtensionType: + parameters: + Token lexeme: undocumented + index: 174 + problemMessage: "Can't have modifier '#lexeme' in an extension type." + correctionMessage: "Try removing '#lexeme'." + analyzerCode: ParserErrorCode.EXTRANEOUS_MODIFIER_IN_EXTENSION_TYPE + script: + - "extension type ET(String i) { foo(covariant String child) {} }" + +ExtraneousModifierInPrimaryConstructor: + parameters: + Token lexeme: undocumented + index: 175 + problemMessage: "Can't have modifier '#lexeme' in a primary constructor." + correctionMessage: "Try removing '#lexeme'." + analyzerCode: ParserErrorCode.EXTRANEOUS_MODIFIER_IN_PRIMARY_CONSTRUCTOR + script: + - "extension type ET(covariant String i) { }" + +FinalAndCovariant: + parameters: none + index: 80 + problemMessage: "Members can't be declared to be both 'final' and 'covariant'." + correctionMessage: "Try removing either the 'final' or 'covariant' keyword." + analyzerCode: ParserErrorCode.FINAL_AND_COVARIANT + script: + - "class C { covariant final f = 5; }" + - "class C { final covariant f = 5; }" + exampleAllowOtherCodes: true + +FinalAndCovariantLateWithInitializer: + parameters: none + index: 101 + problemMessage: "Members marked 'late' with an initializer can't be declared to be both 'final' and 'covariant'." + correctionMessage: "Try removing either the 'final' or 'covariant' keyword, or removing the initializer." + analyzerCode: ParserErrorCode.FINAL_AND_COVARIANT_LATE_WITH_INITIALIZER + # Weak and strong doesn't matter in this instance. + script: + - "class C { covariant late final f = 5; }" + +FinalAndVar: + parameters: none + index: 81 + problemMessage: "Members can't be declared to be both 'final' and 'var'." + correctionMessage: "Try removing the keyword 'var'." + analyzerCode: ParserErrorCode.FINAL_AND_VAR + script: + - "class C { final var x = 5; }" + - "class C { var final x = 5; }" + +StaticConstructor: + parameters: none + index: 4 + problemMessage: "Constructors can't be static." + correctionMessage: "Try removing the keyword 'static'." + analyzerCode: ParserErrorCode.STATIC_CONSTRUCTOR + script: + - "class C { static C() {} }" + - "class C { static C.m() {} }" + +GetterConstructor: + parameters: none + index: 103 + problemMessage: "Constructors can't be a getter." + correctionMessage: "Try removing 'get'." + analyzerCode: ParserErrorCode.GETTER_CONSTRUCTOR + script: + - "class C { get C.m() {} }" + +SetterConstructor: + parameters: none + index: 104 + problemMessage: "Constructors can't be a setter." + correctionMessage: "Try removing 'set'." + analyzerCode: ParserErrorCode.SETTER_CONSTRUCTOR + script: + - "class C { set C.m(x) {} }" + +StaticOperator: + parameters: none + index: 17 + problemMessage: "Operators can't be static." + correctionMessage: "Try removing the keyword 'static'." + analyzerCode: ParserErrorCode.STATIC_OPERATOR + script: + - "class C { static operator +(int x) => x + 1; }" + +BreakOutsideOfLoop: + parameters: none + index: 52 + problemMessage: "A break statement can't be used outside of a loop or switch statement." + correctionMessage: "Try removing the break statement." + analyzerCode: ParserErrorCode.BREAK_OUTSIDE_OF_LOOP + script: + - "main() { break; }" + +ContinueOutsideOfLoop: + parameters: none + index: 2 + problemMessage: "A continue statement can't be used outside of a loop or switch statement." + correctionMessage: "Try removing the continue statement." + analyzerCode: ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP + script: + - "main() { continue; }" + exampleAllowOtherCodes: true + +ContinueWithoutLabelInCase: + parameters: none + index: 64 + problemMessage: "A continue statement in a switch statement must have a label as a target." + correctionMessage: "Try adding a label associated with one of the case clauses to the continue statement." + analyzerCode: ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE + script: + - "main(List<String> x) { switch (x) {case 1: continue;} }" + +DuplicateLabelInSwitchStatement: + parameters: + Name name: undocumented + index: 72 + problemMessage: "The label '#name' was already used in this switch statement." + correctionMessage: "Try choosing a different name for this label." + analyzerCode: ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT + comment: |- + Parameters: + 0: the label that was duplicated + statement: + - "switch (0) {l1: case 0: break; l1: case 1: break;}" + +InitializedVariableInForEach: + parameters: none + index: 82 + problemMessage: "The loop variable in a for-each loop can't be initialized." + correctionMessage: "Try removing the initializer, or using a different kind of loop." + analyzerCode: ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH + statement: + - "for (int a = 0 in <int>[10]) {}" + +InvalidAwaitFor: + parameters: none + index: 9 + problemMessage: "The keyword 'await' isn't allowed for a normal 'for' statement." + correctionMessage: "Try removing the keyword, or use a for-each statement." + analyzerCode: ParserErrorCode.INVALID_AWAIT_IN_FOR + script: + - "f() async {await for (int i = 0; i < 5; i++) {}}" + +VoidWithTypeArguments: + parameters: none + problemMessage: "Type 'void' can't have type arguments." + correctionMessage: "Try removing the type arguments." + index: 100 + analyzerCode: ParserErrorCode.VOID_WITH_TYPE_ARGUMENTS + script: + - "void<int> f() {}" + +# TODO(danrubel): Review where this error is generated and consider generating +# FieldInitializedOutsideDeclaringClass instead of this in some situations. +InvalidInitializer: + parameters: none + index: 90 + problemMessage: "Not a valid initializer." + correctionMessage: "To initialize a field, use the syntax 'name = value'." + analyzerCode: ParserErrorCode.INVALID_INITIALIZER + script: | + class A { + int a = 0; + } + + class B extends A { + B() : super.a = 42; + } + exampleAllowOtherCodes: true + +FieldInitializedOutsideDeclaringClass: + parameters: none + index: 88 + problemMessage: "A field can only be initialized in its declaring class" + correctionMessage: "Try passing a value into the superclass constructor, or moving the initialization into the constructor body." + analyzerCode: ParserErrorCode.FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS + script: + - "class A { int a; } class C extends A { C() : super.a = 42; }" + exampleAllowOtherCodes: true + +StackOverflow: + parameters: none + index: 19 + problemMessage: "The file has too many nested expressions or statements." + correctionMessage: "Try simplifying the code." + analyzerCode: ParserErrorCode.STACK_OVERFLOW + +InvalidHexEscape: + parameters: none + index: 40 + problemMessage: "An escape sequence starting with '\\x' must be followed by 2 hexadecimal digits." + analyzerCode: ParserErrorCode.INVALID_HEX_ESCAPE + expression: + - "'\\x0'" + - "'\\x0y'" + +InvalidUnicodeEscapeUStarted: + parameters: none + index: 38 + problemMessage: "An escape sequence starting with '\\u' must be followed by 4 hexadecimal digits or from 1 to 6 digits between '{' and '}'." + analyzerCode: ParserErrorCode.INVALID_UNICODE_ESCAPE_U_STARTED + expression: + - "'\\u'" + +InvalidUnicodeEscapeUNoBracket: + parameters: none + index: 124 + problemMessage: "An escape sequence starting with '\\u' must be followed by 4 hexadecimal digits." + analyzerCode: ParserErrorCode.INVALID_UNICODE_ESCAPE_U_NO_BRACKET + expression: + - "'\\u0F'" + +InvalidUnicodeEscapeUBracket: + parameters: none + index: 125 + problemMessage: "An escape sequence starting with '\\u{' must be followed by 1 to 6 hexadecimal digits followed by a '}'." + analyzerCode: ParserErrorCode.INVALID_UNICODE_ESCAPE_U_BRACKET + expression: + - "'\\u{'" + - "'\\u{03'" + - "'\\u{0Z}'" + - "'\\u{0000003}'" + +InvalidEscapeStarted: + parameters: none + index: 126 + problemMessage: "The string '\\' can't stand alone." + correctionMessage: "Try adding another backslash (\\) to escape the '\\'." + analyzerCode: ParserErrorCode.INVALID_UNICODE_ESCAPE_STARTED + exampleAllowOtherCodes: true + expression: + - | + print('Hello, World!\ + '); + +UnexpectedTokens: + parameters: none + problemMessage: "Unexpected tokens." + analyzerCode: ParserErrorCode.UNEXPECTED_TOKENS + index: 123 + script: "enum E w Foo { v; }" + +LiteralWithClassAndNew: + parameters: + String string: undocumented + Token lexeme: undocumented + problemMessage: "A #string literal can't be prefixed by 'new #lexeme'." + correctionMessage: "Try removing 'new' and '#lexeme'" + analyzerCode: ParserErrorCode.LITERAL_WITH_CLASS_AND_NEW + index: 115 + script: + - "var x = new Map{};" + - "var x = new Set{};" + - "var x = new List[];" + - "var x = new Map{1: 2};" + - "var x = new Set{1};" + - "var x = new List[1];" + +LiteralWithClass: + parameters: + String string: undocumented + Token lexeme: undocumented + problemMessage: "A #string literal can't be prefixed by '#lexeme'." + correctionMessage: "Try removing '#lexeme'" + analyzerCode: ParserErrorCode.LITERAL_WITH_CLASS + index: 116 + script: + - "var x = Map{};" + - "var x = Set{};" + - "var x = List<String>[];" + - "var x = Map{1: 2};" + - "var x = Set{1};" + - "var x = List<int>[1];" + - "var x = const Map{};" + - "var x = const Set{};" + - "var x = const List[];" + - "var x = const Map{1: 2};" + - "var x = const Set{1};" + - "var x = const List[1];" + +LiteralWithNew: + parameters: none + problemMessage: "A literal can't be prefixed by 'new'." + correctionMessage: "Try removing 'new'" + analyzerCode: ParserErrorCode.LITERAL_WITH_NEW + index: 117 + script: + - "var x = new <String, String>{};" + - "var x = new <String>{};" + - "var x = new {};" + - "var x = new [];" + - "var x = new <String, String>{'a': 'b'};" + - "var x = new <String>{'a'};" + - "var x = new {'a': 'b'};" + - "var x = new {'a'};" + - "var x = new ['a'];" + +OnlyTry: + parameters: none + index: 20 + problemMessage: "A try block must be followed by an 'on', 'catch', or 'finally' clause." + correctionMessage: "Try adding either a catch or finally clause, or remove the try statement." + analyzerCode: ParserErrorCode.MISSING_CATCH_OR_FINALLY + statement: "try {}" + +TypeAfterVar: + parameters: none + index: 89 + problemMessage: "Variables can't be declared using both 'var' and a type name." + correctionMessage: "Try removing 'var.'" + analyzerCode: ParserErrorCode.VAR_AND_TYPE + script: + - "var String foo; main(){}" + exampleAllowOtherCodes: true + +CatchSyntax: + parameters: none + index: 84 + problemMessage: "'catch' must be followed by '(identifier)' or '(identifier, identifier)'." + correctionMessage: "No types are needed, the first is given by 'on', the second is always 'StackTrace'." + analyzerCode: ParserErrorCode.CATCH_SYNTAX + statement: + - "try {} catch {}" + - "try {} catch () {}" + - "try {} catch (e,) {}" + +CatchSyntaxExtraParameters: + parameters: none + index: 83 + problemMessage: "'catch' must be followed by '(identifier)' or '(identifier, identifier)'." + correctionMessage: "No types are needed, the first is given by 'on', the second is always 'StackTrace'." + analyzerCode: ParserErrorCode.CATCH_SYNTAX_EXTRA_PARAMETERS + statement: + - "try {} catch (e, s, x) {}" + +SuperNullAware: + parameters: none + index: 18 + problemMessage: "The operator '?.' cannot be used with 'super' because 'super' cannot be null." + correctionMessage: "Try replacing '?.' with '.'" + analyzerCode: ParserErrorCode.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER + script: | + class Super { + Super.named(); + } + class Class extends Super { + Class() : super?.named(); + } + exampleAllowOtherCodes: true + +NullAwareCascadeOutOfOrder: + parameters: none + index: 96 + problemMessage: "The '?..' cascade operator must be first in the cascade sequence." + correctionMessage: "Try moving the '?..' operator to be the first cascade operator in the sequence." + analyzerCode: ParserErrorCode.NULL_AWARE_CASCADE_OUT_OF_ORDER + script: | + void foo(int? x) { + x + ..hashCode + ?..isEven; + } + exampleAllowOtherCodes: true + +MetadataTypeArguments: + parameters: none + index: 91 + problemMessage: "An annotation can't use type arguments." + analyzerCode: ParserErrorCode.ANNOTATION_WITH_TYPE_ARGUMENTS + script: | + // @dart=2.12 + class C<T> { + const C(); + } + @C<int>() // Error + void foo() {} + +MetadataTypeArgumentsUninstantiated: + parameters: none + index: 114 + problemMessage: "An annotation with type arguments must be followed by an argument list." + analyzerCode: ParserErrorCode.ANNOTATION_WITH_TYPE_ARGUMENTS_UNINSTANTIATED + script: + - "@deprecated<int> class C {}" + +MetadataSpaceBeforeParenthesis: + parameters: none + index: 134 + problemMessage: "Annotations can't have spaces or comments before the parenthesis." + correctionMessage: Remove any spaces or comments before the parenthesis. + analyzerCode: ParserErrorCode.ANNOTATION_SPACE_BEFORE_PARENTHESIS + script: + - >- + class Foo<T> { + const Foo(); + } + @Foo<int> () var bar; + - >- + class Foo { + const Foo(); + } + @Foo () class Bar {} + +ConstructorWithReturnType: + parameters: none + index: 55 + problemMessage: "Constructors can't have a return type." + correctionMessage: "Try removing the return type." + analyzerCode: ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE + script: + - "class C { int C() {} }" + - "class C { void C.m() {} }" + +ConstructorWithTypeParameters: + parameters: none + index: 99 + problemMessage: "Constructors can't have type parameters." + analyzerCode: ParserErrorCode.TYPE_PARAMETER_ON_CONSTRUCTOR + correctionMessage: "Try removing the type parameters." + script: + - >- + class C { C<T>() {} } + - >- + class C { C.foo<T>() {} } + - >- + class C { + factory C<T>() => new C.internal(); + C.internal(); + } + - >- + class C { + factory C.foo<T>() => new C.internal(); + C.internal(); + } + +ConstructorWithTypeArguments: + parameters: none + problemMessage: "A constructor invocation can't have type arguments after the constructor name." + correctionMessage: "Try removing the type arguments or placing them after the class name." + analyzerCode: ParserErrorCode.CONSTRUCTOR_WITH_TYPE_ARGUMENTS + index: 118 + script: + - "class C<X> { C.foo(); } bar() { new C.foo<int>(); }" + - "class C<X> { C.foo(); } bar() { C.foo<int>(); }" + +ConstructorWithWrongName: + parameters: none + problemMessage: "The name of a constructor must match the name of the enclosing class." + analyzerCode: ParserErrorCode.INVALID_CONSTRUCTOR_NAME + index: 102 + script: + - >- + class A { B.foo() {} } + - >- + class A { + factory B() => new A.internal(); + A.internal(); + } + - >- + class A { + factory B.foo() => new A.internal(); + A.internal(); + } + +FieldInitializerOutsideConstructor: + parameters: none + index: 79 + problemMessage: "Field formal parameters can only be used in a constructor." + correctionMessage: "Try removing 'this.'." + analyzerCode: ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR + hasPublishedDocs: true + script: + - "class C { void m(this.x); }" + exampleAllowOtherCodes: true + +NativeClauseShouldBeAnnotation: + parameters: none + index: 23 + problemMessage: "Native clause in this form is deprecated." + correctionMessage: "Try removing this native clause and adding @native() or @native('native-name') before the declaration." + analyzerCode: ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION + +MissingPrefixInDeferredImport: + parameters: none + index: 30 + problemMessage: "Deferred imports should have a prefix." + correctionMessage: "Try adding a prefix to the import by adding an 'as' clause." + analyzerCode: ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT + script: + main.dart: | + import 'lib.dart' deferred; + lib.dart: "" + +DeferredAfterPrefix: + parameters: none + index: 68 + problemMessage: "The deferred keyword should come immediately before the prefix ('as' clause)." + correctionMessage: "Try moving the deferred keyword before the prefix." + analyzerCode: ParserErrorCode.DEFERRED_AFTER_PREFIX + script: + main.dart: | + import "lib.dart" as foo deferred; + lib.dart: "" + +DuplicateDeferred: + parameters: none + index: 71 + problemMessage: "An import directive can only have one 'deferred' keyword." + correctionMessage: "Try removing all but one 'deferred' keyword." + analyzerCode: ParserErrorCode.DUPLICATE_DEFERRED + script: + main.dart: | + import "lib.dart" deferred as foo deferred; + lib.dart: "" + +DuplicatePrefix: + parameters: none + index: 73 + problemMessage: "An import directive can only have one prefix ('as' clause)." + correctionMessage: "Try removing all but one prefix." + analyzerCode: ParserErrorCode.DUPLICATE_PREFIX + script: + main.dart: | + import "lib.dart" as foo as bar; + lib.dart: "" + +PrefixAfterCombinator: + parameters: none + index: 6 + problemMessage: "The prefix ('as' clause) should come before any show/hide combinators." + correctionMessage: "Try moving the prefix before the combinators." + analyzerCode: ParserErrorCode.PREFIX_AFTER_COMBINATOR + script: + main.dart: | + import "lib.dart" show Foo hide Foo as Foo; + lib.dart: "" + +MixinDeclaresConstructor: + parameters: none + index: 95 + problemMessage: "Mixins can't declare constructors." + analyzerCode: ParserErrorCode.MIXIN_DECLARES_CONSTRUCTOR + script: | + mixin M { + const M(); + } + +ExtensionDeclaresAbstractMember: + parameters: none + index: 94 + problemMessage: "Extensions can't declare abstract members." + correctionMessage: "Try providing an implementation for the member." + script: | + extension E on int { + void method(); + } + analyzerCode: ParserErrorCode.EXTENSION_DECLARES_ABSTRACT_MEMBER + comment: No parameters. + documentation: |- + #### Description + + The analyzer produces this diagnostic when an abstract declaration is + declared in an extension. Extensions can declare only concrete members. + + #### Example + + The following code produces this diagnostic because the method `a` doesn't + have a body: + + ```dart + extension E on String { + int [!a!](); + } + ``` + + #### Common fixes + + Either provide an implementation for the member or remove it. + hasPublishedDocs: true + +ExtensionDeclaresConstructor: + parameters: none + index: 92 + problemMessage: "Extensions can't declare constructors." + correctionMessage: "Try removing the constructor declaration." + script: | + extension E on int { + E(); + } + analyzerCode: ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR + comment: No parameters. + documentation: |- + #### Description + + The analyzer produces this diagnostic when a constructor declaration is + found in an extension. It isn't valid to define a constructor because + extensions aren't classes, and it isn't possible to create an instance of + an extension. + + #### Example + + The following code produces this diagnostic because there is a constructor + declaration in `E`: + + ```dart + extension E on String { + [!E!]() : super(); + } + ``` + + #### Common fixes + + Remove the constructor or replace it with a static method. + hasPublishedDocs: true + +ExtensionAugmentationHasOnClause: + parameters: none + index: 93 + problemMessage: "Extension augmentations can't have 'on' clauses." + correctionMessage: "Try removing the 'on' clause." + analyzerCode: ParserErrorCode.EXTENSION_AUGMENTATION_HAS_ON_CLAUSE + script: | + augment extension E on int {} + comment: No parameters. + +AnnotationOnTypeArgument: + parameters: none + problemMessage: "Type arguments can't have annotations because they aren't declarations." + analyzerCode: ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT + index: 111 + script: + - "class A<E> {} class C { m() => new A<@Object() C>(); }" + +ExternalClass: + parameters: none + index: 3 + problemMessage: "Classes can't be declared to be 'external'." + correctionMessage: "Try removing the keyword 'external'." + analyzerCode: ParserErrorCode.EXTERNAL_CLASS + script: + - "external class C {}" + +ExternalEnum: + parameters: none + index: 5 + problemMessage: "Enums can't be declared to be 'external'." + correctionMessage: "Try removing the keyword 'external'." + analyzerCode: ParserErrorCode.EXTERNAL_ENUM + script: + - "external enum E {ONE}" + +ExternalMethodWithBody: + parameters: none + index: 49 + problemMessage: "An external or native method can't have a body." + analyzerCode: ParserErrorCode.EXTERNAL_METHOD_WITH_BODY + script: + - "class C {external foo() {}}" + - "class C {foo() native {}}" + - "class C {foo() native 'bar' {}}" + +ExternalConstructorWithInitializer: + parameters: none + index: 106 + problemMessage: "An external constructor can't have any initializers." + analyzerCode: ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_INITIALIZER + script: + - "class C { int? x; external C() : x = 1; }" + - "class C { int? x; external C.foo() : x = 1; }" + +ExternalTypedef: + parameters: none + index: 76 + problemMessage: "Typedefs can't be declared to be 'external'." + correctionMessage: "Try removing the keyword 'external'." + analyzerCode: ParserErrorCode.EXTERNAL_TYPEDEF + script: + - "external typedef F();" + +OperatorWithTypeParameters: + parameters: none + index: 120 + problemMessage: "Types parameters aren't allowed when defining an operator." + correctionMessage: "Try removing the type parameters." + analyzerCode: ParserErrorCode.TYPE_PARAMETER_ON_OPERATOR + comment: |- + 7.1.1 Operators: Type parameters are not syntactically supported on an + operator. + script: + - "class C { operator []<T>(T t) => null; }" + +LibraryDirectiveNotFirst: + parameters: none + index: 37 + problemMessage: "The library directive must appear before all other directives." + correctionMessage: "Try moving the library directive before any other directives." + analyzerCode: ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST + script: + - "class Foo{} library l;" + - "import 'x.dart'; library l;" + - "part 'a.dart'; library l;" + exampleAllowOtherCodes: true + +ImportAfterPart: + parameters: none + index: 10 + problemMessage: "Import directives must precede part directives." + correctionMessage: "Try moving the import directives before the part directives." + analyzerCode: ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE + script: + - "part 'foo.dart'; import 'bar.dart';" + exampleAllowOtherCodes: true + +ExportAfterPart: + parameters: none + index: 75 + problemMessage: "Export directives must precede part directives." + correctionMessage: "Try moving the export directives before the part directives." + analyzerCode: ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE + exampleAllowOtherCodes: true + script: + - "part 'foo.dart'; export 'bar.dart';" + +DirectiveAfterDeclaration: + parameters: none + index: 69 + problemMessage: "Directives must appear before any declarations." + correctionMessage: "Try moving the directive before any declarations." + analyzerCode: ParserErrorCode.DIRECTIVE_AFTER_DECLARATION + script: + - main.dart: | + class foo { } + import 'bar.dart'; + bar.dart: "" + - main.dart: | + class foo { } + export 'bar.dart'; + bar.dart: "" + +PartOfTwice: + parameters: none + index: 25 + problemMessage: "Only one part-of directive may be declared in a file." + correctionMessage: "Try removing all but one of the part-of directives." + analyzerCode: ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES + script: + - main.dart: | + part "part.dart"; + main() {} + other.dart: "" + part.dart: | + part of "other.dart"; + part of "main.dart"; + - main.dart: | + part of "lib.dart"; + part of "lib.dart"; + main() {} + lib.dart: | + part "main.dart"; + - main.dart: | + part "part.dart"; + part.dart: | + part of "main.dart"; + part of "main.dart"; + +FactoryTopLevelDeclaration: + parameters: none + index: 78 + problemMessage: "Top-level declarations can't be declared to be 'factory'." + correctionMessage: "Try removing the keyword 'factory'." + analyzerCode: ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION + script: + - "factory class C {}" + +RedirectionInNonFactory: + parameters: none + index: 21 + problemMessage: "Only factory constructor can specify '=' redirection." + correctionMessage: "Try making this a factory constructor, or remove the redirection." + analyzerCode: ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR + script: + - "class C { C() = D; }" + exampleAllowOtherCodes: true + +TopLevelOperator: + parameters: none + index: 14 + problemMessage: "Operators must be declared within a class." + correctionMessage: "Try removing the operator, moving it to a class, or converting it to be a function." + analyzerCode: ParserErrorCode.TOP_LEVEL_OPERATOR + script: + - "operator +(bool x, bool y) => x | y;" + - "bool operator +(bool x, bool y) => x | y;" + - "void operator +(bool x, bool y) => x | y;" + +TypeArgumentsOnTypeVariable: + parameters: + Name name: undocumented + index: 13 + problemMessage: "Can't use type arguments with type variable '#name'." + correctionMessage: "Try removing the type arguments." + analyzerCode: ParserErrorCode.TYPE_ARGUMENTS_ON_TYPE_VARIABLE + script: + - "void method<S>(S<int> a) {}" + +# Use this message when a duplicated declaration is introduced. For example: +# +# class C {} // First declaration (related information points here). +# class C {} // Duplicated declaration (error here). +# main() { +# new C(); // Use of duplicated declaration. +# } +# +# We follow the convention from C that a definition is the unique element that +# provides the implementation of a name, and a declaration may not be unique +# (for example, forward declaration). Using this terminology, one could argue +# that a method that is abstract or external is a declaration, not a +# definition. Similarly, imported names are declarations, not +# definitions. Consequently, it is more convenient to use the word +# "declaration" instead of "definition" as the former implies less. +MemberWithSameNameAsClass: + parameters: none + problemMessage: "A class member can't have the same name as the enclosing class." + correctionMessage: "Try renaming the member." + analyzerCode: ParserErrorCode.MEMBER_WITH_CLASS_NAME + index: 105 + script: + - "class C { get C {} }" + - "class C { get C => 42; }" + - "class C { set C(x) {} }" + - "class C { set C(x) => 42; }" + - "class C { int? C; }" + - "class C { int? A, B, C, D, E; }" + +MissingOperatorKeyword: + parameters: none + index: 31 + problemMessage: "Operator declarations must be preceded by the keyword 'operator'." + correctionMessage: "Try adding the keyword 'operator'." + analyzerCode: ParserErrorCode.MISSING_KEYWORD_OPERATOR + script: + - "class C { +(x) {} }" + +InvalidOperator: + parameters: + Token lexeme: undocumented + index: 39 + problemMessage: "The string '#lexeme' isn't a user-definable operator." + analyzerCode: ParserErrorCode.INVALID_OPERATOR + comment: |- + Parameters: + 0: the operator that is invalid + script: + - "class C { void operator %=(x) {} }" + +InvalidSuperInInitializer: + parameters: none + index: 47 + problemMessage: "Can only use 'super' in an initializer for calling the superclass constructor (e.g. 'super()' or 'super.namedConstructor()')" + analyzerCode: ParserErrorCode.INVALID_SUPER_IN_INITIALIZER + +InvalidThisInInitializer: + parameters: none + index: 65 + problemMessage: "Can only use 'this' in an initializer for field initialization (e.g. 'this.x = something') and constructor redirection (e.g. 'this()' or 'this.namedConstructor())" + analyzerCode: ParserErrorCode.INVALID_THIS_IN_INITIALIZER + +SwitchHasCaseAfterDefault: + parameters: none + index: 16 + problemMessage: "The default case should be the last case in a switch statement." + correctionMessage: "Try moving the default case after the other case clauses." + analyzerCode: ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE + script: + - "class C { foo(int a) {switch (a) {default: return 0; case 1: return 1;}} }" + +SwitchHasMultipleDefaults: + parameters: none + index: 15 + problemMessage: "The 'default' case can only be declared once." + correctionMessage: "Try removing all but one default case." + analyzerCode: ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES + script: + - "class C { foo(int a) {switch (a) {default: return 0; default: return 1;}} }" + +ExpectedAnInitializer: + parameters: none + index: 36 + problemMessage: "Expected an initializer." + analyzerCode: ParserErrorCode.MISSING_INITIALIZER + script: + - "class C { C() : {} }" + +MissingAssignmentInInitializer: + parameters: none + index: 34 + problemMessage: "Expected an assignment after the field name." + correctionMessage: "To initialize a field, use the syntax 'name = value'." + analyzerCode: ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER + script: + - "class C { C() : x(3) {} }" + exampleAllowOtherCodes: true + +RedirectingConstructorWithBody: + parameters: none + index: 22 + problemMessage: "Redirecting constructors can't have a body." + correctionMessage: "Try removing the body, or not making this a redirecting constructor." + analyzerCode: ParserErrorCode.REDIRECTING_CONSTRUCTOR_WITH_BODY + script: + - "class C { C() : this.x() {} }" + exampleAllowOtherCodes: true + +IllegalAssignmentToNonAssignable: + parameters: none + index: 45 + problemMessage: "Illegal assignment to non-assignable expression." + analyzerCode: ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE + script: + - "main(){ f()++; }" + +MissingAssignableSelector: + parameters: none + index: 35 + problemMessage: "Missing selector such as '.identifier' or '[0]'." + correctionMessage: "Try adding a selector." + analyzerCode: ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR + script: + - "main(){ ++f(); }" + +ColonInPlaceOfIn: + parameters: none + index: 54 + problemMessage: "For-in loops use 'in' rather than a colon." + correctionMessage: "Try replacing the colon with the keyword 'in'." + analyzerCode: ParserErrorCode.COLON_IN_PLACE_OF_IN + script: | + void foo() { + for(var x : []) {} + } + +BinaryOperatorWrittenOut: + parameters: + String string: undocumented + String string2: undocumented + index: 112 + problemMessage: "Binary operator '#string' is written as '#string2' instead of the written out word." + correctionMessage: "Try replacing '#string' with '#string2'." + analyzerCode: ParserErrorCode.BINARY_OPERATOR_WRITTEN_OUT + script: | + int foo(int x, int y) => x xor y; + +ExternalFactoryRedirection: + parameters: none + index: 85 + problemMessage: "A redirecting factory can't be external." + correctionMessage: "Try removing the 'external' modifier." + analyzerCode: ParserErrorCode.EXTERNAL_FACTORY_REDIRECTION + script: | + class Foo { + Foo._(int i); + external factory Foo.x(int i) = Foo._; + } + +MultipleVarianceModifiers: + parameters: none + index: 97 + problemMessage: "Each type parameter can have at most one variance modifier." + correctionMessage: "Use at most one of the 'in', 'out', or 'inout' modifiers." + analyzerCode: ParserErrorCode.MULTIPLE_VARIANCE_MODIFIERS + experiments: variance + script: | + class C<in out X> {} + + +BaseEnum: + parameters: none + index: 155 + problemMessage: "Enums can't be declared to be 'base'." + correctionMessage: "Try removing the keyword 'base'." + analyzerCode: ParserErrorCode.BASE_ENUM + script: + - "base enum E { v }" + +FinalEnum: + parameters: none + index: 156 + problemMessage: "Enums can't be declared to be 'final'." + correctionMessage: "Try removing the keyword 'final'." + analyzerCode: ParserErrorCode.FINAL_ENUM + script: + - "final enum E { v }" + +InterfaceEnum: + parameters: none + index: 157 + problemMessage: "Enums can't be declared to be 'interface'." + correctionMessage: "Try removing the keyword 'interface'." + analyzerCode: ParserErrorCode.INTERFACE_ENUM + script: + - "interface enum E { v }" + +SealedEnum: + parameters: none + index: 158 + problemMessage: "Enums can't be declared to be 'sealed'." + correctionMessage: "Try removing the keyword 'sealed'." + analyzerCode: ParserErrorCode.SEALED_ENUM + script: + - "sealed enum E { v }" + +FinalMixin: + parameters: none + index: 146 + problemMessage: "A mixin can't be declared 'final'." + correctionMessage: "Try removing the 'final' keyword." + analyzerCode: ParserErrorCode.FINAL_MIXIN + script: + - "final mixin M {}" + +InterfaceMixin: + parameters: none + index: 147 + problemMessage: "A mixin can't be declared 'interface'." + correctionMessage: "Try removing the 'interface' keyword." + analyzerCode: ParserErrorCode.INTERFACE_MIXIN + script: + - "interface mixin M {}" + +SealedMixin: + parameters: none + index: 148 + problemMessage: "A mixin can't be declared 'sealed'." + correctionMessage: "Try removing the 'sealed' keyword." + analyzerCode: ParserErrorCode.SEALED_MIXIN + script: + - "sealed mixin M {}" + +FinalMixinClass: + parameters: none + index: 142 + problemMessage: "A mixin class can't be declared 'final'." + correctionMessage: "Try removing the 'final' keyword." + analyzerCode: ParserErrorCode.FINAL_MIXIN_CLASS + script: + - "final mixin class C {}" + +InterfaceMixinClass: + parameters: none + index: 143 + problemMessage: "A mixin class can't be declared 'interface'." + correctionMessage: "Try removing the 'interface' keyword." + analyzerCode: ParserErrorCode.INTERFACE_MIXIN_CLASS + script: + - "interface mixin class C {}" + +SealedMixinClass: + parameters: none + index: 144 + problemMessage: "A mixin class can't be declared 'sealed'." + correctionMessage: "Try removing the 'sealed' keyword." + analyzerCode: ParserErrorCode.SEALED_MIXIN_CLASS + script: + - "sealed mixin class C {}" + +InvalidConstantPatternNegation: + parameters: none + problemMessage: "Only negation of a numeric literal is supported as a constant pattern." + correctionMessage: "Try wrapping the expression in 'const ( ... )'." + analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_NEGATION + index: 135 + script: | + method(x) { + const y = 5; + if (x case -y) {} + } + +InvalidConstantPatternUnary: + parameters: + Name name: undocumented + problemMessage: "The unary operator #name is not supported as a constant pattern." + correctionMessage: "Try wrapping the expression in 'const ( ... )'." + analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_UNARY + index: 136 + script: | + method(x) { + const y = false; + if (x case !y) {} + } + +InvalidConstantPatternDuplicateConst: + parameters: none + problemMessage: "Duplicate 'const' keyword in constant expression." + correctionMessage: "Try removing one of the 'const' keywords." + analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_DUPLICATE_CONST + index: 137 + script: | + method(x) { + if (x case const const []) {} + } + +InvalidConstantPatternEmptyRecordLiteral: + parameters: none + problemMessage: "The empty record literal is not supported as a constant pattern." + analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_EMPTY_RECORD_LITERAL + index: 138 + script: | + method(x) { + if (x case const ()) {} + } + +InvalidConstantPatternGeneric: + parameters: none + problemMessage: "This expression is not supported as a constant pattern." + correctionMessage: "Try wrapping the expression in 'const ( ... )'." + analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_GENERIC + index: 139 + script: | + method(x) { + if (x case List<int>) {} + } + +InvalidConstantPatternConstPrefix: + parameters: none + problemMessage: "The expression can't be prefixed by 'const' to form a constant pattern." + correctionMessage: "Try wrapping the expression in 'const ( ... )' instead." + analyzerCode: ParserErrorCode.INVALID_CONSTANT_CONST_PREFIX + index: 140 + script: | + method(x) { + if (x case const 1) {} + } + +InvalidConstantPatternBinary: + parameters: + Name name: undocumented + problemMessage: "The binary operator #name is not supported as a constant pattern." + correctionMessage: "Try wrapping the expression in 'const ( ... )'." + analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_BINARY + index: 141 + script: | + method(x) { + if (x case 1 + 2) {} + } + +PatternAssignmentDeclaresVariable: + parameters: + Name name: undocumented + problemMessage: "Variable '#name' can't be declared in a pattern assignment." + correctionMessage: "Try using a preexisting variable or changing the assignment to a pattern variable declaration." + analyzerCode: ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE + index: 145 + script: | + method(x) { + var y; + [y, var z] = x; + } + +VariablePatternKeywordInDeclarationContext: + parameters: none + problemMessage: Variable patterns in declaration context can't specify 'var' or 'final' keyword. + correctionMessage: Try removing the keyword. + analyzerCode: ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT + index: 149 + comment: No parameters. + hasPublishedDocs: true + script: | + void f((int, int) r) { + var (var x, y) = r; + print(x + y); + } + documentation: |- + #### Description + + The analyzer produces this diagnostic when a variable pattern is used + within a declaration context. + + #### Example + + The following code produces this diagnostic because the variable patterns + in the record pattern are in a declaration context: + + ```dart + void f((int, int) r) { + var ([!var!] x, y) = r; + print(x + y); + } + ``` + + #### Common fixes + + Remove the `var` or `final` keyword(s) within the variable pattern: + + ```dart + void f((int, int) r) { + var (x, y) = r; + print(x + y); + } + ``` + +IllegalPatternVariableName: + parameters: + Token lexeme: undocumented + problemMessage: The variable declared by a variable pattern can't be named '#lexeme'. + correctionMessage: Choose a different name. + analyzerCode: ParserErrorCode.ILLEGAL_PATTERN_VARIABLE_NAME + index: 159 + comment: |- + Parameters: + 0: the illegal name + script: | + void f(x) { + switch (x) { + case var when: + } + } + +IllegalPatternAssignmentVariableName: + parameters: + Token lexeme: undocumented + problemMessage: A variable assigned by a pattern assignment can't be named '#lexeme'. + correctionMessage: Choose a different name. + analyzerCode: ParserErrorCode.ILLEGAL_PATTERN_ASSIGNMENT_VARIABLE_NAME + index: 160 + comment: |- + Parameters: + 0: the illegal name + script: | + void f(x) { + dynamic when; + (when) = x; + } + +IllegalPatternIdentifierName: + parameters: + Token lexeme: undocumented + problemMessage: A pattern can't refer to an identifier named '#lexeme'. + correctionMessage: Match the identifier using '== #lexeme'. + analyzerCode: ParserErrorCode.ILLEGAL_PATTERN_IDENTIFIER_NAME + index: 161 + comment: |- + Parameters: + 0: the illegal name + script: | + void f(x) { + const when = 0; + switch (x) { + case when: + } + } + +InvalidInsideUnaryPattern: + parameters: none + problemMessage: This pattern cannot appear inside a unary pattern (cast pattern, null check pattern, or null assert pattern) without parentheses. + correctionMessage: Try combining into a single pattern if possible, or enclose the inner pattern in parentheses. + analyzerCode: ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN + index: 150 + comment: No parameters. + script: | + void f(x) { + if (x case _ as int as num) {} + } + +LatePatternVariableDeclaration: + parameters: none + problemMessage: A pattern variable declaration may not use the `late` keyword. + correctionMessage: Try removing the keyword `late`. + analyzerCode: ParserErrorCode.LATE_PATTERN_VARIABLE_DECLARATION + index: 151 + comment: No parameters. + script: | + void f(x) { + late var (y, z) = x; + } + +PatternVariableDeclarationOutsideFunctionOrMethod: + parameters: none + problemMessage: A pattern variable declaration may not appear outside a function or method. + correctionMessage: Try declaring ordinary variables and assigning from within a function or method. + analyzerCode: ParserErrorCode.PATTERN_VARIABLE_DECLARATION_OUTSIDE_FUNCTION_OR_METHOD + index: 152 + comment: No parameters. + script: | + class C { + var (a, b) = (0, 1); + } + +DefaultInSwitchExpression: + parameters: none + problemMessage: A switch expression may not use the `default` keyword. + correctionMessage: Try replacing `default` with `_`. + analyzerCode: ParserErrorCode.DEFAULT_IN_SWITCH_EXPRESSION + index: 153 + comment: No parameters. + script: | + void f(x) => switch (x) { + 1 => 'one', + default => 'other' + }; + +MissingPrimaryConstructor: + parameters: none + problemMessage: "An extension type declaration must have a primary constructor declaration." + correctionMessage: "Try adding a primary constructor to the extension type declaration." + index: 162 + analyzerCode: ParserErrorCode.MISSING_PRIMARY_CONSTRUCTOR + script: | + extension type E {} + +MissingPrimaryConstructorParameters: + parameters: none + problemMessage: "A primary constructor declaration must have formal parameters." + correctionMessage: "Try adding formal parameters after the primary constructor name." + index: 163 + analyzerCode: ParserErrorCode.MISSING_PRIMARY_CONSTRUCTOR_PARAMETERS + script: | + extension type E.name {} + +ExtensionTypeExtends: + parameters: none + problemMessage: "An extension type declaration can't have an 'extends' clause." + correctionMessage: "Try removing the 'extends' clause or replacing the 'extends' with 'implements'." + index: 164 + analyzerCode: ParserErrorCode.EXTENSION_TYPE_EXTENDS + script: | + extension type F(int i) {} + extension type E(int i) extends F {} + +ExtensionTypeWith: + parameters: none + problemMessage: "An extension type declaration can't have a 'with' clause." + correctionMessage: "Try removing the 'with' clause or replacing the 'with' with 'implements'." + index: 165 + analyzerCode: ParserErrorCode.EXTENSION_TYPE_WITH + script: | + extension type F(int i) {} + extension type E(int i) with F {} +
diff --git a/pkg/analyzer/test/src/fasta/message_coverage_test.dart b/pkg/analyzer/test/src/fasta/message_coverage_test.dart index 5cb418c..564b141 100644 --- a/pkg/analyzer/test/src/fasta/message_coverage_test.dart +++ b/pkg/analyzer/test/src/fasta/message_coverage_test.dart
@@ -38,7 +38,7 @@ /// Return a list of the front end messages that define an 'analyzerCode'. List<String> getMappedCodes() { Set<String> codes = <String>{}; - for (var entry in frontEndMessages.entries) { + for (var entry in frontEndAndSharedMessages.entries) { var name = entry.key; var errorCodeInfo = entry.value; if (errorCodeInfo.analyzerCode.isNotEmpty) { @@ -52,7 +52,7 @@ /// `messages.yaml` file. List<String> getReferencedCodes() { Set<String> codes = <String>{}; - for (var errorCodeInfo in frontEndMessages.values) { + for (var errorCodeInfo in frontEndAndSharedMessages.values) { codes.addAll(errorCodeInfo.analyzerCode); } return codes.toList();
diff --git a/pkg/analyzer/tool/messages/error_code_info.dart b/pkg/analyzer/tool/messages/error_code_info.dart index 6930960..80aceaf 100644 --- a/pkg/analyzer/tool/messages/error_code_info.dart +++ b/pkg/analyzer/tool/messages/error_code_info.dart
@@ -168,7 +168,7 @@ /// A set of tables mapping between front end and analyzer error codes. final CfeToAnalyzerErrorCodeTables cfeToAnalyzerErrorCodeTables = - CfeToAnalyzerErrorCodeTables._(frontEndMessages); + CfeToAnalyzerErrorCodeTables._(frontEndAndSharedMessages); /// The path to the `linter` package. final String linterPkgPath = normalize(join(pkg_root.packageRoot, 'linter')); @@ -334,7 +334,7 @@ /// automatically generated, and whose values are the front end error name. final Map<ErrorCodeInfo, String> infoToFrontEndCode = {}; - CfeToAnalyzerErrorCodeTables._(Map<String, FrontEndErrorCodeInfo> messages) { + CfeToAnalyzerErrorCodeTables._(Map<String, CfeStyleErrorCodeInfo> messages) { for (var entry in messages.entries) { var errorCodeInfo = entry.value; var index = errorCodeInfo.index;
diff --git a/pkg/analyzer_utilities/lib/messages.dart b/pkg/analyzer_utilities/lib/messages.dart index e423258..0cde2c2 100644 --- a/pkg/analyzer_utilities/lib/messages.dart +++ b/pkg/analyzer_utilities/lib/messages.dart
@@ -20,9 +20,25 @@ 'INFO': 'info', }; +/// Decoded messages from the `_fe_analyzer_shared` package's `messages.yaml` +/// file. +final Map<String, CfeStyleErrorCodeInfo> feAnalyzerSharedMessages = + _loadCfeStyleMessages(feAnalyzerSharedPkgPath, isShared: true); + +/// The path to the `fe_analyzer_shared` package. +final String feAnalyzerSharedPkgPath = normalize( + join(pkg_root.packageRoot, '_fe_analyzer_shared'), +); + +/// Decoded messages from the `messages.yaml` files in the front end and +/// `_fe_analyzer_shared`. +final Map<String, CfeStyleErrorCodeInfo> frontEndAndSharedMessages = Map.from( + frontEndMessages, +)..addAll(feAnalyzerSharedMessages); + /// Decoded messages from the front end's `messages.yaml` file. -final Map<String, FrontEndErrorCodeInfo> frontEndMessages = - _loadFrontEndMessages(); +final Map<String, CfeStyleErrorCodeInfo> frontEndMessages = + _loadCfeStyleMessages(frontEndPkgPath, isShared: false); /// The path to the `front_end` package. final String frontEndPkgPath = normalize( @@ -51,14 +67,17 @@ ); } -/// Decodes a YAML object (obtained from `pkg/front_end/messages.yaml`) into a -/// map from error name to [ErrorCodeInfo]. -Map<String, FrontEndErrorCodeInfo> decodeCfeMessagesYaml(Object? yaml) { +/// Decodes a YAML object (in CFE style `messages.yaml` format) into a map from +/// error name to [ErrorCodeInfo]. +Map<String, CfeStyleErrorCodeInfo> decodeCfeStyleMessagesYaml( + Object? yaml, { + required bool isShared, +}) { Never problem(String message) { throw 'Problem in pkg/front_end/messages.yaml: $message'; } - var result = <String, FrontEndErrorCodeInfo>{}; + var result = <String, CfeStyleErrorCodeInfo>{}; if (yaml is! Map<Object?, Object?>) { problem('root node is not a map'); } @@ -72,7 +91,10 @@ problem('value associated with error $errorName is not a map'); } try { - result[errorName] = FrontEndErrorCodeInfo.fromYaml(errorValue); + result[errorName] = CfeStyleErrorCodeInfo.fromYaml( + errorValue, + isShared: isShared, + ); } catch (e, st) { Error.throwWithStackTrace('while processing $errorName, $e', st); } @@ -80,14 +102,17 @@ return result; } -/// Loads front end messages from the front end's `messages.yaml` file. -Map<String, FrontEndErrorCodeInfo> _loadFrontEndMessages() { - var path = join(frontEndPkgPath, 'messages.yaml'); +/// Loads messages in CFE style `messages.yaml` format. +Map<String, CfeStyleErrorCodeInfo> _loadCfeStyleMessages( + String packagePath, { + required bool isShared, +}) { + var path = join(packagePath, 'messages.yaml'); Object? messagesYaml = loadYaml( File(path).readAsStringSync(), sourceUrl: Uri.file(path), ); - return decodeCfeMessagesYaml(messagesYaml); + return decodeCfeStyleMessagesYaml(messagesYaml, isShared: isShared); } /// Splits [text] on spaces using the given [maxWidth] (and [firstLineWidth] if @@ -130,6 +155,86 @@ return lines; } +/// In-memory representation of error code information obtained from a +/// `messages.yaml` file in `pkg/front_end` or `pkg/_fe_analyzer_shared`. +class CfeStyleErrorCodeInfo extends ErrorCodeInfo { + /// The set of analyzer error codes that corresponds to this error code, if + /// any. + final List<String> analyzerCode; + + /// The index of the error in the analyzer's `fastaAnalyzerErrorCodes` table. + final int? index; + + /// The name of the [CfeSeverity] constant describing this error code's CFE + /// severity. + final String? cfeSeverity; + + CfeStyleErrorCodeInfo.fromYaml(YamlMap yaml, {required bool isShared}) + : analyzerCode = _decodeAnalyzerCode(yaml['analyzerCode']), + index = _decodeIndex(yaml['index']), + cfeSeverity = _decodeSeverity(yaml['severity']), + super.fromYaml(yaml) { + if (yaml['problemMessage'] == null) { + throw 'Missing problemMessage'; + } + if (isShared && analyzerCode.length != 1) { + throw StateError('Shared messages must have exactly one analyzerCode'); + } + } + + @override + Map<Object?, Object?> toYaml() => { + if (analyzerCode.isNotEmpty) + 'analyzerCode': _encodeAnalyzerCode(analyzerCode), + if (index != null) 'index': index, + ...super.toYaml(), + }; + + static List<String> _decodeAnalyzerCode(Object? value) { + if (value == null) { + return const []; + } else if (value is String) { + return [value]; + } else if (value is List) { + return [for (var s in value) s as String]; + } else { + throw 'Unrecognized analyzer code: $value'; + } + } + + static int? _decodeIndex(Object? value) { + switch (value) { + case null: + return null; + case int(): + if (value >= 1) { + return value; + } + } + throw 'Expected positive int for "index:", but found $value'; + } + + static String? _decodeSeverity(Object? yamlEntry) { + switch (yamlEntry) { + case null: + return null; + case String(): + return severityEnumNames[yamlEntry] ?? + (throw "Unknown severity '$yamlEntry'"); + default: + throw 'Bad severity type: ${yamlEntry.runtimeType}'; + } + } + + static Object _encodeAnalyzerCode(List<String> analyzerCode) { + if (analyzerCode.length == 1) { + return analyzerCode.single; + } else { + return analyzerCode; + } + } +} + /// Information about how to convert the CFE's internal representation of a /// template parameter to a string. /// @@ -688,83 +793,6 @@ bool get isSupportedByAnalyzer => _analyzerName != null; } -/// In-memory representation of error code information obtained from the front -/// end's `messages.yaml` file. -class FrontEndErrorCodeInfo extends ErrorCodeInfo { - /// The set of analyzer error codes that corresponds to this error code, if - /// any. - final List<String> analyzerCode; - - /// The index of the error in the analyzer's `fastaAnalyzerErrorCodes` table. - final int? index; - - /// The name of the [CfeSeverity] constant describing this error code's CFE - /// severity. - final String? cfeSeverity; - - FrontEndErrorCodeInfo.fromYaml(YamlMap yaml) - : analyzerCode = _decodeAnalyzerCode(yaml['analyzerCode']), - index = _decodeIndex(yaml['index']), - cfeSeverity = _decodeSeverity(yaml['severity']), - super.fromYaml(yaml) { - if (yaml['problemMessage'] == null) { - throw 'Missing problemMessage'; - } - } - - @override - Map<Object?, Object?> toYaml() => { - if (analyzerCode.isNotEmpty) - 'analyzerCode': _encodeAnalyzerCode(analyzerCode), - if (index != null) 'index': index, - ...super.toYaml(), - }; - - static List<String> _decodeAnalyzerCode(Object? value) { - if (value == null) { - return const []; - } else if (value is String) { - return [value]; - } else if (value is List) { - return [for (var s in value) s as String]; - } else { - throw 'Unrecognized analyzer code: $value'; - } - } - - static int? _decodeIndex(Object? value) { - switch (value) { - case null: - return null; - case int(): - if (value >= 1) { - return value; - } - } - throw 'Expected positive int for "index:", but found $value'; - } - - static String? _decodeSeverity(Object? yamlEntry) { - switch (yamlEntry) { - case null: - return null; - case String(): - return severityEnumNames[yamlEntry] ?? - (throw "Unknown severity '$yamlEntry'"); - default: - throw 'Bad severity type: ${yamlEntry.runtimeType}'; - } - } - - static Object _encodeAnalyzerCode(List<String> analyzerCode) { - if (analyzerCode.length == 1) { - return analyzerCode.single; - } else { - return analyzerCode; - } - } -} - /// Representation of a single file containing generated error codes. class GeneratedErrorCodeFile { /// The file path (relative to the SDK's `pkg` directory) of the generated
diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status index ba4f8f6..e973379 100644 --- a/pkg/front_end/messages.status +++ b/pkg/front_end/messages.status
@@ -6,515 +6,515 @@ # always be fixed by either spelling correctly or updating the dictionary. # Missing examples, but probably ok - at least for now. -CannotAssignToSuper/example: missingExample # Not covered. -CannotReadSdkSpecification/example: missingExample # Issued on what is essentially a wrong setup. -CantInferPackagesFromManyInputs/example: missingExample # We don't control input uri in messages test. -CantInferPackagesFromPackageUri/example: missingExample # We don't control input uri in messages test. -ClassShouldBeListedAsCallableInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. -ClassShouldBeListedAsExtendableInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. -ConstEvalError/example: missingExample # Uncovered, at least outside of constant stress testing. -ConstEvalGetterNotFound/example: missingExample # Not covered. -ConstEvalInvalidPropertyGet/example: missingExample # Uncovered, at least outside of constant stress testing. -ConstEvalInvalidRecordIndexGet/example: missingExample # Uncovered, at least outside of constant stress testing. -ConstEvalInvalidRecordNameGet/example: missingExample # Uncovered, at least outside of constant stress testing. -ConstEvalInvalidStaticInvocation/example: missingExample # Happens in some VM tests with @pragma("vm:platform-const") but unclear if it can happen otherwise. -ConstEvalInvalidSymbolName/example: missingExample # Uncovered. Likely unreachable. -ConstEvalKeyImplementsEqual/example: missingExample # Uncovered. -ConstEvalNonConstantVariableGet/example: missingExample # Only covered in constant evaluator stress test. Not clear if it can happen on its own. -ConstEvalStartingPoint/example: missingExample # This is just used for displaying the starting point. -ConstEvalUnevaluated/example: missingExample # Unevaluated consts not possible in this suite. -ConstructorShouldBeListedAsCallableInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. -DartFfiLibraryInDart2Wasm/example: missingExample # Web compiler specific -DillOutlineSummary/example: missingExample # Used for verbose output. -DuplicatedDeclarationUse/part_wrapped_script1: hasOnlyUnrelatedMessages # Seemingly this is not issued as an error, but ends up in the kernel AST. -DuplicatedDeclarationUse/script1: hasOnlyUnrelatedMessages # Seemingly this is not issued as an error, but ends up in the kernel AST. -DuplicatedDeclarationUse/script2: hasOnlyUnrelatedMessages # Seemingly this is not issued as an error, but ends up in the kernel AST. -DynamicCallsAreNotAllowedInDynamicModule/example: missingExample # Can't do dynamic modules stuff in messages suite. -ExceptionReadingFile/example: missingExample # Requires an exception (generally not a FileSystemException) to occur when reading a file. -ExpectedBlockToSkip/example: missingExample # Seemingly only used when skipping a block in a special parser. -ExpectedOneExpression/example: missingExample # Used via expression compilation. -ExpectedStatement/part_wrapped_statement: hasOnlyUnrelatedMessages # Only issued in Analyzer -ExpectedStatement/statement: hasOnlyUnrelatedMessages # Only issued in Analyzer -ExperimentDisabled/example: missingExample # Uncovered. -ExperimentDisabledInvalidLanguageVersion/example: missingExample # Uncovered. -ExperimentExpiredDisabled/example: missingExample # Uncovered. -ExperimentExpiredEnabled/example: missingExample # Uncovered. -ExperimentNotEnabled/example: missingExample # issued via the parser, but overridden by StackListenerImpl --- so likely not possible via CFE outside of special tests? -ExplicitExtensionAsLvalue/example: missingExample # Uncovered. -ExpressionEvaluationKnownVariableUnavailable/example: missingExample # Expression compilation. -ExtensionAugmentationHasOnClause/part_wrapped_script: hasOnlyUnrelatedMessages # Doesn't seem to be any (direct?) way to get this for now -ExtensionAugmentationHasOnClause/script: hasOnlyUnrelatedMessages # Doesn't seem to be any (direct?) way to get this for now -ExtensionTypeShouldBeListedAsCallableInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. -FastaCLIArgumentRequired/example: missingExample # Used in the compile tool -FastaUsageLong/example: missingExample # Help for the compile tool -FastaUsageShort/example: missingExample # Help for the compile tool -IllegalAssignmentToNonAssignable/part_wrapped_script1: hasOnlyUnrelatedMessages # Possibly not reachable in the CFE -IllegalAssignmentToNonAssignable/script1: hasOnlyUnrelatedMessages # Possibly not reachable in the CFE -IncrementalCompilerIllegalParameter/example: missingExample # Expression compilation. -IncrementalCompilerIllegalTypeParameter/example: missingExample # Expression compilation. -IndexOutOfBoundInRecordIndexGet/example: missingExample # Not covered. -InputFileNotFound/example: missingExample # Issued for additional dills that doesn't exist. -InvalidAugmentSuper/example: missingExample # Doesn't seem to be any (direct?) way to get this for now -InvalidCastFunctionExpr/example: missingExample # Seemingly not actually issued in any tests. -InvalidCastLiteralList/example: missingExample # Seemingly not actually issued in any tests. -InvalidCastLiteralMap/example: missingExample # Seemingly not actually issued in any tests. -InvalidCastLiteralSet/example: missingExample # Seemingly not actually issued in any tests. -InvalidCastLocalFunction/example: missingExample # Seemingly not actually issued in any tests. -InvalidCastNewExpr/example: missingExample # Seemingly not actually issued in any tests. -InvalidCastStaticMethod/example: missingExample # Seemingly not actually issued in any tests. -InvalidCastTopLevelFunction/example: missingExample # Not covered. -InvalidSuperInInitializer/example: missingExample # Only issued in Analyzer -InvalidThisInInitializer/example: missingExample # Only issued in Analyzer -JsInteropDartClassExtendsJSClass/example: missingExample # Web compiler specific -JsInteropDartJsInteropAnnotationForStaticInteropOnly/example: missingExample # Web compiler specific -JsInteropDisallowedInteropLibraryInDart2Wasm/example: missingExample # Web compiler specific -JsInteropEnclosingClassJSAnnotation/example: missingExample # Web compiler specific -JsInteropExportClassNotMarkedExportable/example: missingExample # Web compiler specific -JsInteropExportDartInterfaceHasNonEmptyJSExportValue/example: missingExample # Web compiler specific -JsInteropExportDisallowedMember/example: missingExample # Web compiler specific -JsInteropExportInvalidInteropTypeArgument/example: missingExample # Web compiler specific -JsInteropExportInvalidTypeArgument/example: missingExample # Web compiler specific -JsInteropExportMemberCollision/example: missingExample # Web compiler specific -JsInteropExportNoExportableMembers/example: missingExample # Web compiler specific -JsInteropExtensionTypeMemberNotInterop/example: missingExample # Web compiler specific -JsInteropExtensionTypeNotInterop/example: missingExample # Web compiler specific -JsInteropExtensionTypeUsedWithWrongJsAnnotation/example: missingExample # Web compiler specific -JsInteropExternalExtensionMemberOnTypeInvalid/example: missingExample # Web compiler specific -JsInteropExternalExtensionMemberWithStaticDisallowed/example: missingExample # Web compiler specific -JsInteropExternalMemberNotJSAnnotated/example: missingExample # Web compiler specific -JsInteropFunctionToJSNamedParameters/example: missingExample # Web compiler specific -JsInteropFunctionToJSRequiresStaticType/example: missingExample # Web compiler specific -JsInteropFunctionToJSTypeParameters/example: missingExample # Web compiler specific -JsInteropInvalidStaticClassMemberName/example: missingExample # Web compiler specific -JsInteropIsAInvalidTypeVariable/example: missingExample # Web compiler specific -JsInteropIsAObjectLiteralType/example: missingExample # Web compiler specific -JsInteropIsAPrimitiveExtensionType/example: missingExample # Web compiler specific -JsInteropIsATearoff/example: missingExample # Web compiler specific -JsInteropJSClassExtendsDartClass/example: missingExample # Web compiler specific -JsInteropNamedParameters/example: missingExample # Web compiler specific -JsInteropNativeClassInAnnotation/example: missingExample # Web compiler specific -JsInteropNonExternalConstructor/example: missingExample # Web compiler specific -JsInteropNonExternalMember/example: missingExample # Web compiler specific -JsInteropNonStaticWithStaticInteropSupertype/example: missingExample # Web compiler specific -JsInteropObjectLiteralConstructorPositionalParameters/example: missingExample # Web compiler specific -JsInteropOperatorCannotBeRenamed/example: missingExample # Web compiler specific -JsInteropOperatorsNotSupported/example: missingExample # Web compiler specific -JsInteropStaticInteropExternalAccessorTypeViolation/example: missingExample # Web compiler specific -JsInteropStaticInteropExternalFunctionTypeViolation/example: missingExample # Web compiler specific -JsInteropStaticInteropGenerativeConstructor/example: missingExample # Web compiler specific -JsInteropStaticInteropMockMissingGetterOrSetter/example: missingExample # Web compiler specific -JsInteropStaticInteropMockMissingImplements/example: missingExample # Web compiler specific -JsInteropStaticInteropMockNotStaticInteropType/example: missingExample # Web compiler specific -JsInteropStaticInteropMockTypeParametersNotAllowed/example: missingExample # Web compiler specific -JsInteropStaticInteropNoJSAnnotation/example: missingExample # Web compiler specific -JsInteropStaticInteropParameterInitializersAreIgnored/example: missingExample # Web compiler specific -JsInteropStaticInteropSyntheticConstructor/example: missingExample # Web compiler specific -JsInteropStaticInteropTearOffsDisallowed/example: missingExample # Web compiler specific -JsInteropStaticInteropToJSFunctionTypeViolation/example: missingExample # Web compiler specific -JsInteropStaticInteropTrustTypesUsageNotAllowed/example: missingExample # Web compiler specific -JsInteropStaticInteropTrustTypesUsedWithoutStaticInterop/example: missingExample # Web compiler specific -JsInteropStaticInteropWithInstanceMembers/example: missingExample # Web compiler specific -JsInteropStaticInteropWithNonStaticSupertype/example: missingExample # Web compiler specific -LanguageVersionMismatchInPatch/example: missingExample # Patching. -MemberShouldBeListedAsCallableInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. -MemberShouldBeListedAsCanBeOverriddenInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. -MissingAssignableSelector/part_wrapped_script1: hasOnlyUnrelatedMessages # Only issued in Analyzer -MissingAssignableSelector/script1: hasOnlyUnrelatedMessages # Only issued in Analyzer -MissingInput/example: missingExample # Issued on what is essentially a wrong setup. -MissingMain/example: missingExample # Main is only required in some compilation modes, and not in messages testing. -NameNotFoundInRecordNameGet/example: missingExample # Uncovered. -NativeClauseShouldBeAnnotation/example: missingExample # Swallowed in StackListener.dart. -NeverReachableSwitchDefaultError/example: missingExample # Probably only added to AST, but never issued. -NeverReachableSwitchExpressionError/example: missingExample # No coverage. -NeverReachableSwitchStatementError/example: missingExample # No coverage. -NeverValueError/example: missingExample # No coverage. -NoAugmentSuperInvokeTarget/example: missingExample # Doesn't seem to be any (direct?) way to get this for now -NoAugmentSuperReadTarget/example: missingExample # Doesn't seem to be any (direct?) way to get this for now -NoAugmentSuperWriteTarget/example: missingExample # Doesn't seem to be any (direct?) way to get this for now -NonPartOfDirectiveInPart/script1: hasOnlyUnrelatedMessages # Specifically ignored in `isIgnoredParserError`?!? -NoUnnamedConstructorInObject/example: missingExample # No coverage. -PatchClassTypeParametersMismatch/example: missingExample # Patching. -PatchExtensionTypeParametersMismatch/example: missingExample # Patching. -PatchInjectionFailed/example: missingExample # Patching. -PatternMatchingError/example: missingExample # Seemingly this is not issued as an error, but ends up in the kernel AST. -PositionalAfterNamedArgument/example: missingExample # Seemingly only issued in Analyzer -RecordUseCannotBePlacedHere/example: missingExample # No coverage. -SdkRootNotFound/example: missingExample # Issued on what is essentially a wrong setup. -SdkSpecificationNotFound/example: missingExample # Issued on what is essentially a wrong setup. -SdkSummaryNotFound/example: missingExample # Issued on what is essentially a wrong setup. -SourceBodySummary/example: missingExample # Used for verbose output. -SourceOutlineSummary/example: missingExample # Used for verbose output. -StackOverflow/example: missingExample # Requires 500 nested expressions. -SuperclassHasNoMember/example: missingExample # Not covered... -SyntheticToken/example: missingExample # Seemingly this is not issued as an error, but ends up in the kernel AST. -UnmatchedAugmentationClass/example: missingExample # Doesn't seem to be any (direct?) way to get this for now -UnmatchedAugmentationClassMember/example: missingExample # Doesn't seem to be any (direct?) way to get this for now -UnmatchedAugmentationConstructor/example: missingExample # Doesn't seem to be any (direct?) way to get this for now -UnmatchedAugmentationDeclaration/example: missingExample # Doesn't seem to be any (direct?) way to get this for now -UnmatchedAugmentationLibraryMember/example: missingExample # Doesn't seem to be any (direct?) way to get this for now -UnmatchedPatchClass/example: missingExample # Patching. -UnmatchedPatchClassMember/example: missingExample # Patching. -UnmatchedPatchDeclaration/example: missingExample # Patching. -UnmatchedPatchLibraryMember/example: missingExample # Patching. -UnsoundSwitchExpressionError/example: missingExample # Used in throw in code, but not issued as a message. -UnsoundSwitchStatementError/example: missingExample # Used in throw in code, but not issued as a message. -Unspecified/example: missingExample # This should generally not be used. -UnterminatedToken/example: missingExample # This is a fall-back message that shouldn't happen. -WasmImportOrExportInUserCode/example: missingExample # only issued by wasm build -WebLiteralCannotBeRepresentedExactly/example: missingExample # only issued on web build +front_end/CannotAssignToSuper/example: missingExample # Not covered. +front_end/CannotReadSdkSpecification/example: missingExample # Issued on what is essentially a wrong setup. +front_end/CantInferPackagesFromManyInputs/example: missingExample # We don't control input uri in messages test. +front_end/CantInferPackagesFromPackageUri/example: missingExample # We don't control input uri in messages test. +front_end/ClassShouldBeListedAsCallableInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. +front_end/ClassShouldBeListedAsExtendableInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. +front_end/ConstEvalError/example: missingExample # Uncovered, at least outside of constant stress testing. +front_end/ConstEvalGetterNotFound/example: missingExample # Not covered. +front_end/ConstEvalInvalidPropertyGet/example: missingExample # Uncovered, at least outside of constant stress testing. +front_end/ConstEvalInvalidRecordIndexGet/example: missingExample # Uncovered, at least outside of constant stress testing. +front_end/ConstEvalInvalidRecordNameGet/example: missingExample # Uncovered, at least outside of constant stress testing. +front_end/ConstEvalInvalidStaticInvocation/example: missingExample # Happens in some VM tests with @pragma("vm:platform-const") but unclear if it can happen otherwise. +front_end/ConstEvalInvalidSymbolName/example: missingExample # Uncovered. Likely unreachable. +front_end/ConstEvalKeyImplementsEqual/example: missingExample # Uncovered. +front_end/ConstEvalNonConstantVariableGet/example: missingExample # Only covered in constant evaluator stress test. Not clear if it can happen on its own. +front_end/ConstEvalStartingPoint/example: missingExample # This is just used for displaying the starting point. +front_end/ConstEvalUnevaluated/example: missingExample # Unevaluated consts not possible in this suite. +front_end/ConstructorShouldBeListedAsCallableInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. +front_end/DartFfiLibraryInDart2Wasm/example: missingExample # Web compiler specific +front_end/DillOutlineSummary/example: missingExample # Used for verbose output. +front_end/DuplicatedDeclarationUse/part_wrapped_script1: hasOnlyUnrelatedMessages # Seemingly this is not issued as an error, but ends up in the kernel AST. +front_end/DuplicatedDeclarationUse/script1: hasOnlyUnrelatedMessages # Seemingly this is not issued as an error, but ends up in the kernel AST. +front_end/DuplicatedDeclarationUse/script2: hasOnlyUnrelatedMessages # Seemingly this is not issued as an error, but ends up in the kernel AST. +front_end/DynamicCallsAreNotAllowedInDynamicModule/example: missingExample # Can't do dynamic modules stuff in messages suite. +front_end/ExceptionReadingFile/example: missingExample # Requires an exception (generally not a FileSystemException) to occur when reading a file. +front_end/ExpectedBlockToSkip/example: missingExample # Seemingly only used when skipping a block in a special parser. +front_end/ExpectedOneExpression/example: missingExample # Used via expression compilation. +_fe_analyzer_shared/ExpectedStatement/part_wrapped_statement: hasOnlyUnrelatedMessages # Only issued in Analyzer +_fe_analyzer_shared/ExpectedStatement/statement: hasOnlyUnrelatedMessages # Only issued in Analyzer +front_end/ExperimentDisabled/example: missingExample # Uncovered. +front_end/ExperimentDisabledInvalidLanguageVersion/example: missingExample # Uncovered. +front_end/ExperimentExpiredDisabled/example: missingExample # Uncovered. +front_end/ExperimentExpiredEnabled/example: missingExample # Uncovered. +_fe_analyzer_shared/ExperimentNotEnabled/example: missingExample # issued via the parser, but overridden by StackListenerImpl --- so likely not possible via CFE outside of special tests? +front_end/ExplicitExtensionAsLvalue/example: missingExample # Uncovered. +front_end/ExpressionEvaluationKnownVariableUnavailable/example: missingExample # Expression compilation. +_fe_analyzer_shared/ExtensionAugmentationHasOnClause/part_wrapped_script: hasOnlyUnrelatedMessages # Doesn't seem to be any (direct?) way to get this for now +_fe_analyzer_shared/ExtensionAugmentationHasOnClause/script: hasOnlyUnrelatedMessages # Doesn't seem to be any (direct?) way to get this for now +front_end/ExtensionTypeShouldBeListedAsCallableInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. +front_end/FastaCLIArgumentRequired/example: missingExample # Used in the compile tool +front_end/FastaUsageLong/example: missingExample # Help for the compile tool +front_end/FastaUsageShort/example: missingExample # Help for the compile tool +_fe_analyzer_shared/IllegalAssignmentToNonAssignable/part_wrapped_script1: hasOnlyUnrelatedMessages # Possibly not reachable in the CFE +_fe_analyzer_shared/IllegalAssignmentToNonAssignable/script1: hasOnlyUnrelatedMessages # Possibly not reachable in the CFE +front_end/IncrementalCompilerIllegalParameter/example: missingExample # Expression compilation. +front_end/IncrementalCompilerIllegalTypeParameter/example: missingExample # Expression compilation. +front_end/IndexOutOfBoundInRecordIndexGet/example: missingExample # Not covered. +front_end/InputFileNotFound/example: missingExample # Issued for additional dills that doesn't exist. +front_end/InvalidAugmentSuper/example: missingExample # Doesn't seem to be any (direct?) way to get this for now +front_end/InvalidCastFunctionExpr/example: missingExample # Seemingly not actually issued in any tests. +front_end/InvalidCastLiteralList/example: missingExample # Seemingly not actually issued in any tests. +front_end/InvalidCastLiteralMap/example: missingExample # Seemingly not actually issued in any tests. +front_end/InvalidCastLiteralSet/example: missingExample # Seemingly not actually issued in any tests. +front_end/InvalidCastLocalFunction/example: missingExample # Seemingly not actually issued in any tests. +front_end/InvalidCastNewExpr/example: missingExample # Seemingly not actually issued in any tests. +front_end/InvalidCastStaticMethod/example: missingExample # Seemingly not actually issued in any tests. +front_end/InvalidCastTopLevelFunction/example: missingExample # Not covered. +_fe_analyzer_shared/InvalidSuperInInitializer/example: missingExample # Only issued in Analyzer +_fe_analyzer_shared/InvalidThisInInitializer/example: missingExample # Only issued in Analyzer +front_end/JsInteropDartClassExtendsJSClass/example: missingExample # Web compiler specific +front_end/JsInteropDartJsInteropAnnotationForStaticInteropOnly/example: missingExample # Web compiler specific +front_end/JsInteropDisallowedInteropLibraryInDart2Wasm/example: missingExample # Web compiler specific +front_end/JsInteropEnclosingClassJSAnnotation/example: missingExample # Web compiler specific +front_end/JsInteropExportClassNotMarkedExportable/example: missingExample # Web compiler specific +front_end/JsInteropExportDartInterfaceHasNonEmptyJSExportValue/example: missingExample # Web compiler specific +front_end/JsInteropExportDisallowedMember/example: missingExample # Web compiler specific +front_end/JsInteropExportInvalidInteropTypeArgument/example: missingExample # Web compiler specific +front_end/JsInteropExportInvalidTypeArgument/example: missingExample # Web compiler specific +front_end/JsInteropExportMemberCollision/example: missingExample # Web compiler specific +front_end/JsInteropExportNoExportableMembers/example: missingExample # Web compiler specific +front_end/JsInteropExtensionTypeMemberNotInterop/example: missingExample # Web compiler specific +front_end/JsInteropExtensionTypeNotInterop/example: missingExample # Web compiler specific +front_end/JsInteropExtensionTypeUsedWithWrongJsAnnotation/example: missingExample # Web compiler specific +front_end/JsInteropExternalExtensionMemberOnTypeInvalid/example: missingExample # Web compiler specific +front_end/JsInteropExternalExtensionMemberWithStaticDisallowed/example: missingExample # Web compiler specific +front_end/JsInteropExternalMemberNotJSAnnotated/example: missingExample # Web compiler specific +front_end/JsInteropFunctionToJSNamedParameters/example: missingExample # Web compiler specific +front_end/JsInteropFunctionToJSRequiresStaticType/example: missingExample # Web compiler specific +front_end/JsInteropFunctionToJSTypeParameters/example: missingExample # Web compiler specific +front_end/JsInteropInvalidStaticClassMemberName/example: missingExample # Web compiler specific +front_end/JsInteropIsAInvalidTypeVariable/example: missingExample # Web compiler specific +front_end/JsInteropIsAObjectLiteralType/example: missingExample # Web compiler specific +front_end/JsInteropIsAPrimitiveExtensionType/example: missingExample # Web compiler specific +front_end/JsInteropIsATearoff/example: missingExample # Web compiler specific +front_end/JsInteropJSClassExtendsDartClass/example: missingExample # Web compiler specific +front_end/JsInteropNamedParameters/example: missingExample # Web compiler specific +front_end/JsInteropNativeClassInAnnotation/example: missingExample # Web compiler specific +front_end/JsInteropNonExternalConstructor/example: missingExample # Web compiler specific +front_end/JsInteropNonExternalMember/example: missingExample # Web compiler specific +front_end/JsInteropNonStaticWithStaticInteropSupertype/example: missingExample # Web compiler specific +front_end/JsInteropObjectLiteralConstructorPositionalParameters/example: missingExample # Web compiler specific +front_end/JsInteropOperatorCannotBeRenamed/example: missingExample # Web compiler specific +front_end/JsInteropOperatorsNotSupported/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropExternalAccessorTypeViolation/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropExternalFunctionTypeViolation/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropGenerativeConstructor/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropMockMissingGetterOrSetter/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropMockMissingImplements/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropMockNotStaticInteropType/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropMockTypeParametersNotAllowed/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropNoJSAnnotation/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropParameterInitializersAreIgnored/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropSyntheticConstructor/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropTearOffsDisallowed/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropToJSFunctionTypeViolation/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropTrustTypesUsageNotAllowed/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropTrustTypesUsedWithoutStaticInterop/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropWithInstanceMembers/example: missingExample # Web compiler specific +front_end/JsInteropStaticInteropWithNonStaticSupertype/example: missingExample # Web compiler specific +front_end/LanguageVersionMismatchInPatch/example: missingExample # Patching. +front_end/MemberShouldBeListedAsCallableInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. +front_end/MemberShouldBeListedAsCanBeOverriddenInDynamicInterface/example: missingExample # Can't do dynamic modules stuff in messages suite. +_fe_analyzer_shared/MissingAssignableSelector/part_wrapped_script1: hasOnlyUnrelatedMessages # Only issued in Analyzer +_fe_analyzer_shared/MissingAssignableSelector/script1: hasOnlyUnrelatedMessages # Only issued in Analyzer +front_end/MissingInput/example: missingExample # Issued on what is essentially a wrong setup. +front_end/MissingMain/example: missingExample # Main is only required in some compilation modes, and not in messages testing. +front_end/NameNotFoundInRecordNameGet/example: missingExample # Uncovered. +_fe_analyzer_shared/NativeClauseShouldBeAnnotation/example: missingExample # Swallowed in StackListener.dart. +front_end/NeverReachableSwitchDefaultError/example: missingExample # Probably only added to AST, but never issued. +front_end/NeverReachableSwitchExpressionError/example: missingExample # No coverage. +front_end/NeverReachableSwitchStatementError/example: missingExample # No coverage. +front_end/NeverValueError/example: missingExample # No coverage. +front_end/NoAugmentSuperInvokeTarget/example: missingExample # Doesn't seem to be any (direct?) way to get this for now +front_end/NoAugmentSuperReadTarget/example: missingExample # Doesn't seem to be any (direct?) way to get this for now +front_end/NoAugmentSuperWriteTarget/example: missingExample # Doesn't seem to be any (direct?) way to get this for now +front_end/NonPartOfDirectiveInPart/script1: hasOnlyUnrelatedMessages # Specifically ignored in `isIgnoredParserError`?!? +front_end/NoUnnamedConstructorInObject/example: missingExample # No coverage. +front_end/PatchClassTypeParametersMismatch/example: missingExample # Patching. +front_end/PatchExtensionTypeParametersMismatch/example: missingExample # Patching. +front_end/PatchInjectionFailed/example: missingExample # Patching. +front_end/PatternMatchingError/example: missingExample # Seemingly this is not issued as an error, but ends up in the kernel AST. +front_end/PositionalAfterNamedArgument/example: missingExample # Seemingly only issued in Analyzer +front_end/RecordUseCannotBePlacedHere/example: missingExample # No coverage. +front_end/SdkRootNotFound/example: missingExample # Issued on what is essentially a wrong setup. +front_end/SdkSpecificationNotFound/example: missingExample # Issued on what is essentially a wrong setup. +front_end/SdkSummaryNotFound/example: missingExample # Issued on what is essentially a wrong setup. +front_end/SourceBodySummary/example: missingExample # Used for verbose output. +front_end/SourceOutlineSummary/example: missingExample # Used for verbose output. +_fe_analyzer_shared/StackOverflow/example: missingExample # Requires 500 nested expressions. +front_end/SuperclassHasNoMember/example: missingExample # Not covered... +front_end/SyntheticToken/example: missingExample # Seemingly this is not issued as an error, but ends up in the kernel AST. +front_end/UnmatchedAugmentationClass/example: missingExample # Doesn't seem to be any (direct?) way to get this for now +front_end/UnmatchedAugmentationClassMember/example: missingExample # Doesn't seem to be any (direct?) way to get this for now +front_end/UnmatchedAugmentationConstructor/example: missingExample # Doesn't seem to be any (direct?) way to get this for now +front_end/UnmatchedAugmentationDeclaration/example: missingExample # Doesn't seem to be any (direct?) way to get this for now +front_end/UnmatchedAugmentationLibraryMember/example: missingExample # Doesn't seem to be any (direct?) way to get this for now +front_end/UnmatchedPatchClass/example: missingExample # Patching. +front_end/UnmatchedPatchClassMember/example: missingExample # Patching. +front_end/UnmatchedPatchDeclaration/example: missingExample # Patching. +front_end/UnmatchedPatchLibraryMember/example: missingExample # Patching. +front_end/UnsoundSwitchExpressionError/example: missingExample # Used in throw in code, but not issued as a message. +front_end/UnsoundSwitchStatementError/example: missingExample # Used in throw in code, but not issued as a message. +front_end/Unspecified/example: missingExample # This should generally not be used. +front_end/UnterminatedToken/example: missingExample # This is a fall-back message that shouldn't happen. +front_end/WasmImportOrExportInUserCode/example: missingExample # only issued by wasm build +front_end/WebLiteralCannotBeRepresentedExactly/example: missingExample # only issued on web build # Can we do better? -ConstAndFinal/declaration3: hasOnlyUnrelatedMessages # maybe the parser should do better here - it seems it once did? -ConstAndFinal/declaration4: hasOnlyUnrelatedMessages # maybe the parser should do better here - it seems it once did? -ConstAndFinal/part_wrapped_declaration3: hasOnlyUnrelatedMessages # maybe the parser should do better here - it seems it once did? -ConstAndFinal/part_wrapped_declaration4: hasOnlyUnrelatedMessages # maybe the parser should do better here - it seems it once did? +_fe_analyzer_shared/ConstAndFinal/declaration3: hasOnlyUnrelatedMessages # maybe the parser should do better here - it seems it once did? +_fe_analyzer_shared/ConstAndFinal/declaration4: hasOnlyUnrelatedMessages # maybe the parser should do better here - it seems it once did? +_fe_analyzer_shared/ConstAndFinal/part_wrapped_declaration3: hasOnlyUnrelatedMessages # maybe the parser should do better here - it seems it once did? +_fe_analyzer_shared/ConstAndFinal/part_wrapped_declaration4: hasOnlyUnrelatedMessages # maybe the parser should do better here - it seems it once did? # Missing analyzer codes. -AbstractClassConstructorTearOff/analyzerCode: missingAnalyzerCode -AbstractFieldConstructorInitializer/analyzerCode: missingAnalyzerCode -AbstractFieldInitializer/analyzerCode: missingAnalyzerCode -AmbiguousExtensionMethod/analyzerCode: missingAnalyzerCode -AmbiguousExtensionOperator/analyzerCode: missingAnalyzerCode -AmbiguousExtensionProperty/analyzerCode: missingAnalyzerCode -AnnotationOnFunctionTypeTypeParameter/analyzerCode: missingAnalyzerCode -AssertAsExpression/analyzerCode: missingAnalyzerCode -AwaitInLateLocalInitializer/analyzerCode: missingAnalyzerCode -CannotAssignToConstVariable/analyzerCode: missingAnalyzerCode -CannotAssignToExtensionThis/analyzerCode: missingAnalyzerCode -CannotAssignToFinalVariable/analyzerCode: missingAnalyzerCode -CannotAssignToTypeLiteral/analyzerCode: missingAnalyzerCode -CannotReadSdkSpecification/analyzerCode: missingAnalyzerCode -CantDisambiguateAmbiguousInformation/analyzerCode: missingAnalyzerCode # There's no analyzer code for that error yet. -CantDisambiguateNotEnoughInformation/analyzerCode: missingAnalyzerCode # There's no analyzer code for that error yet. -CantHaveNamedParameters/analyzerCode: missingAnalyzerCode -CantHaveOptionalParameters/analyzerCode: missingAnalyzerCode -CantInferPackagesFromManyInputs/analyzerCode: missingAnalyzerCode -CantInferPackagesFromPackageUri/analyzerCode: missingAnalyzerCode -ClassShouldBeListedAsCallableInDynamicInterface/analyzerCode: missingAnalyzerCode -ClassShouldBeListedAsExtendableInDynamicInterface/analyzerCode: missingAnalyzerCode -ConstConstructorLateFinalFieldError/analyzerCode: missingAnalyzerCode -ConstConstructorRedirectionToNonConst/analyzerCode: missingAnalyzerCode # The analyzer doesn't report this error. -ConstEvalCaseImplementsEqual/analyzerCode: missingAnalyzerCode -ConstEvalElementNotPrimitiveEquality/analyzerCode: missingAnalyzerCode -ConstEvalEqualsOperandNotPrimitiveEquality/analyzerCode: missingAnalyzerCode -ConstEvalError/analyzerCode: missingAnalyzerCode -ConstEvalExternalConstructor/analyzerCode: missingAnalyzerCode -ConstEvalExternalFactory/analyzerCode: missingAnalyzerCode -ConstEvalGetterNotFound/analyzerCode: missingAnalyzerCode -ConstEvalInvalidBinaryOperandType/analyzerCode: missingAnalyzerCode # CONST_EVAL_TYPE_NUM / CONST_EVAL_TYPE_BOOL -ConstEvalInvalidEqualsOperandType/analyzerCode: missingAnalyzerCode -ConstEvalInvalidType/analyzerCode: missingAnalyzerCode # CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH / CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH / CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH / ... -ConstEvalKeyNotPrimitiveEquality/analyzerCode: missingAnalyzerCode -ConstEvalNegativeShift/analyzerCode: missingAnalyzerCode -ConstEvalNonNull/analyzerCode: missingAnalyzerCode -ConstEvalStartingPoint/analyzerCode: missingAnalyzerCode # This is just used for displaying the starting point. -ConstEvalTruncateError/analyzerCode: missingAnalyzerCode -ConstEvalUnevaluated/analyzerCode: missingAnalyzerCode -ConstEvalUnhandledCoreException/analyzerCode: missingAnalyzerCode -ConstEvalUnhandledException/analyzerCode: missingAnalyzerCode -ConstructorShouldBeListedAsCallableInDynamicInterface/analyzerCode: missingAnalyzerCode -ConstructorTearOffWithTypeArguments/analyzerCode: missingAnalyzerCode -CouldNotParseUri/analyzerCode: missingAnalyzerCode -CyclicRepresentationDependency/analyzerCode: missingAnalyzerCode -DartFfiLibraryInDart2Wasm/analyzerCode: missingAnalyzerCode -DeferredExtensionImport/analyzerCode: missingAnalyzerCode -DillOutlineSummary/analyzerCode: missingAnalyzerCode -DotShorthandsConstructorInvocationWithTypeArguments/analyzerCode: missingAnalyzerCode # TODO(kallentu): https://github.com/dart-lang/sdk/issues/59835 -DotShorthandsInvalidContext/analyzerCode: missingAnalyzerCode # TODO(kallentu): https://github.com/dart-lang/sdk/issues/59835 -DotShorthandsUndefinedGetter/analyzerCode: missingAnalyzerCode # TODO(kallentu): https://github.com/dart-lang/sdk/issues/59835 -DotShorthandsUndefinedInvocation/analyzerCode: missingAnalyzerCode # TODO(kallentu): https://github.com/dart-lang/sdk/issues/59835 -DuplicatedDeclarationUse/analyzerCode: missingAnalyzerCode # No corresponding analyzer code. -DuplicatedRecordLiteralFieldName/analyzerCode: missingAnalyzerCode -DuplicatedRecordTypeFieldName/analyzerCode: missingAnalyzerCode -DynamicCallsAreNotAllowedInDynamicModule/analyzerCode: missingAnalyzerCode -Encoding/analyzerCode: missingAnalyzerCode -EnumAbstractMember/analyzerCode: missingAnalyzerCode -EnumConstructorSuperInitializer/analyzerCode: missingAnalyzerCode -EnumConstructorTearoff/analyzerCode: missingAnalyzerCode -EnumContainsRestrictedInstanceDeclaration/analyzerCode: missingAnalyzerCode -EnumContainsValuesDeclaration/analyzerCode: missingAnalyzerCode -EnumFactoryRedirectsToConstructor/analyzerCode: missingAnalyzerCode -EnumImplementerContainsRestrictedInstanceDeclaration/analyzerCode: missingAnalyzerCode -EnumImplementerContainsValuesDeclaration/analyzerCode: missingAnalyzerCode -EnumInheritsRestricted/analyzerCode: missingAnalyzerCode -EnumNonConstConstructor/analyzerCode: missingAnalyzerCode -EnumSupertypeOfNonAbstractClass/analyzerCode: missingAnalyzerCode -ExceptionReadingFile/analyzerCode: missingAnalyzerCode -ExpectedOneExpression/analyzerCode: missingAnalyzerCode -ExpectedUri/analyzerCode: missingAnalyzerCode -ExperimentExpiredDisabled/analyzerCode: missingAnalyzerCode -ExperimentExpiredEnabled/analyzerCode: missingAnalyzerCode -ExperimentOptOutExplicit/analyzerCode: missingAnalyzerCode -ExperimentOptOutImplicit/analyzerCode: missingAnalyzerCode -ExplicitExtensionArgumentMismatch/analyzerCode: missingAnalyzerCode -ExplicitExtensionAsExpression/analyzerCode: missingAnalyzerCode -ExplicitExtensionAsLvalue/analyzerCode: missingAnalyzerCode -ExplicitExtensionTypeArgumentMismatch/analyzerCode: missingAnalyzerCode -ExpressionEvaluationKnownVariableUnavailable/analyzerCode: missingAnalyzerCode -ExpressionNotMetadata/analyzerCode: missingAnalyzerCode -ExtendsNever/analyzerCode: missingAnalyzerCode # Feature not yet in analyzer. -ExtensionMemberConflictsWithObjectMember/analyzerCode: missingAnalyzerCode -ExtensionTypePrimaryConstructorFunctionFormalParameterSyntax/analyzerCode: missingAnalyzerCode -ExtensionTypePrimaryConstructorWithInitializingFormal/analyzerCode: missingAnalyzerCode -ExtensionTypeShouldBeListedAsCallableInDynamicInterface/analyzerCode: missingAnalyzerCode -ExternalFieldConstructorInitializer/analyzerCode: missingAnalyzerCode -ExternalFieldInitializer/analyzerCode: missingAnalyzerCode -FastaCLIArgumentRequired/analyzerCode: missingAnalyzerCode -FastaUsageLong/analyzerCode: missingAnalyzerCode -FastaUsageShort/analyzerCode: missingAnalyzerCode -FfiAbiSpecificIntegerInvalid/analyzerCode: missingAnalyzerCode -FfiAbiSpecificIntegerMappingInvalid/analyzerCode: missingAnalyzerCode -FfiAddressPosition/analyzerCode: missingAnalyzerCode -FfiAddressReceiver/analyzerCode: missingAnalyzerCode -FfiCompoundImplementsFinalizable/analyzerCode: missingAnalyzerCode -FfiCreateOfStructOrUnion/analyzerCode: missingAnalyzerCode -FfiDartTypeMismatch/analyzerCode: missingAnalyzerCode -FfiDeeplyImmutableClassesMustBeFinalOrSealed/analyzerCode: missingAnalyzerCode -FfiDeeplyImmutableFieldsModifiers/analyzerCode: missingAnalyzerCode -FfiDeeplyImmutableFieldsMustBeDeeplyImmutable/analyzerCode: missingAnalyzerCode -FfiDeeplyImmutableSubtypesMustBeDeeplyImmutable/analyzerCode: missingAnalyzerCode -FfiDeeplyImmutableSupertypeMustBeDeeplyImmutable/analyzerCode: missingAnalyzerCode -FfiEmptyStruct/analyzerCode: missingAnalyzerCode -FfiExceptionalReturnNull/analyzerCode: missingAnalyzerCode -FfiExpectedConstant/analyzerCode: missingAnalyzerCode -FfiExpectedConstantArg/analyzerCode: missingAnalyzerCode -FfiExpectedExceptionalReturn/analyzerCode: missingAnalyzerCode -FfiExpectedNoExceptionalReturn/analyzerCode: missingAnalyzerCode -FfiExtendsOrImplementsSealedClass/analyzerCode: missingAnalyzerCode -FfiFieldAnnotation/analyzerCode: missingAnalyzerCode -FfiFieldCyclic/analyzerCode: missingAnalyzerCode -FfiFieldInitializer/analyzerCode: missingAnalyzerCode -FfiFieldNoAnnotation/analyzerCode: missingAnalyzerCode -FfiFieldNull/analyzerCode: missingAnalyzerCode -FfiLeafCallMustNotReturnHandle/analyzerCode: missingAnalyzerCode -FfiLeafCallMustNotTakeHandle/analyzerCode: missingAnalyzerCode -FfiNativeCallableListenerReturnVoid/analyzerCode: missingAnalyzerCode -FfiNativeMustBeExternal/analyzerCode: missingAnalyzerCode -FfiNativeOnlyNativeFieldWrapperClassCanBePointer/analyzerCode: missingAnalyzerCode -FfiNativeUnexpectedNumberOfParameters/analyzerCode: missingAnalyzerCode -FfiNativeUnexpectedNumberOfParametersWithReceiver/analyzerCode: missingAnalyzerCode -FfiNotStatic/analyzerCode: missingAnalyzerCode -FfiPackedAnnotation/analyzerCode: missingAnalyzerCode -FfiPackedAnnotationAlignment/analyzerCode: missingAnalyzerCode -FfiSizeAnnotation/analyzerCode: missingAnalyzerCode -FfiSizeAnnotationDimensions/analyzerCode: missingAnalyzerCode -FfiStructGeneric/analyzerCode: missingAnalyzerCode -FfiTypeInvalid/analyzerCode: missingAnalyzerCode -FfiTypeMismatch/analyzerCode: missingAnalyzerCode -FfiVariableLengthArrayNotLast/analyzerCode: missingAnalyzerCode -FieldNonNullableNotInitializedByConstructorError/analyzerCode: missingAnalyzerCode -FieldNonNullableWithoutInitializerError/analyzerCode: missingAnalyzerCode -FieldNotPromotedBecauseConflictingField/analyzerCode: missingAnalyzerCode -FieldNotPromotedBecauseConflictingGetter/analyzerCode: missingAnalyzerCode -FieldNotPromotedBecauseConflictingNsmForwarder/analyzerCode: missingAnalyzerCode -FieldNotPromotedBecauseExternal/analyzerCode: missingAnalyzerCode -FieldNotPromotedBecauseNotEnabled/analyzerCode: missingAnalyzerCode -FieldNotPromotedBecauseNotField/analyzerCode: missingAnalyzerCode -FieldNotPromotedBecauseNotFinal/analyzerCode: missingAnalyzerCode -FieldNotPromotedBecauseNotPrivate/analyzerCode: missingAnalyzerCode -ForInLoopExactlyOneVariable/analyzerCode: missingAnalyzerCode # The analyzer doesn't recover well. -ForInLoopNotAssignable/analyzerCode: missingAnalyzerCode # The analyzer reports a different error. -IllegalAsyncGeneratorVoidReturnType/analyzerCode: missingAnalyzerCode # The analyzer doesn't report this error. -IllegalSyncGeneratorVoidReturnType/analyzerCode: missingAnalyzerCode # The analyzer doesn't report this error. -ImplementMultipleExtensionTypeMembers/analyzerCode: missingAnalyzerCode -ImplementNonExtensionTypeAndExtensionTypeMember/analyzerCode: missingAnalyzerCode -ImplementsFutureOr/analyzerCode: missingAnalyzerCode # The analyzer doesn't report this error. -ImplementsNever/analyzerCode: missingAnalyzerCode # Feature not yet in analyzer. -ImplicitMixinOverride/analyzerCode: missingAnalyzerCode -ImplicitReturnNull/analyzerCode: missingAnalyzerCode -IncrementalCompilerIllegalParameter/analyzerCode: missingAnalyzerCode -IncrementalCompilerIllegalTypeParameter/analyzerCode: missingAnalyzerCode -IndexOutOfBoundInRecordIndexGet/analyzerCode: missingAnalyzerCode -InputFileNotFound/analyzerCode: missingAnalyzerCode -InstantiationNonGenericFunctionType/analyzerCode: missingAnalyzerCode -InstantiationTooFewArguments/analyzerCode: missingAnalyzerCode -InstantiationTooManyArguments/analyzerCode: missingAnalyzerCode -InterfaceCheck/analyzerCode: missingAnalyzerCode -InvalidAugmentSuper/analyzerCode: missingAnalyzerCode -InvalidBreakTarget/analyzerCode: missingAnalyzerCode -InvalidContinueTarget/analyzerCode: missingAnalyzerCode -InvalidExtensionTypeSuperExtensionType/analyzerCode: missingAnalyzerCode -InvalidExtensionTypeSuperInterface/analyzerCode: missingAnalyzerCode -InvalidGetterSetterType/analyzerCode: missingAnalyzerCode -InvalidGetterSetterTypeBothInheritedField/analyzerCode: missingAnalyzerCode -InvalidGetterSetterTypeBothInheritedGetter/analyzerCode: missingAnalyzerCode -InvalidGetterSetterTypeFieldInherited/analyzerCode: missingAnalyzerCode -InvalidGetterSetterTypeGetterInherited/analyzerCode: missingAnalyzerCode -InvalidGetterSetterTypeSetterInheritedField/analyzerCode: missingAnalyzerCode -InvalidGetterSetterTypeSetterInheritedGetter/analyzerCode: missingAnalyzerCode -InvalidPackageUri/analyzerCode: missingAnalyzerCode -InvalidReturn/analyzerCode: missingAnalyzerCode -InvalidReturnAsync/analyzerCode: missingAnalyzerCode -InvalidTypeParameterInSupertype/analyzerCode: missingAnalyzerCode -InvalidTypeParameterInSupertypeWithVariance/analyzerCode: missingAnalyzerCode -InvalidTypeParameterVariancePosition/analyzerCode: missingAnalyzerCode -InvalidTypeParameterVariancePositionInReturnType/analyzerCode: missingAnalyzerCode -JointPatternVariablesMismatch/analyzerCode: missingAnalyzerCode -JsInteropDartClassExtendsJSClass/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropDartJsInteropAnnotationForStaticInteropOnly/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropDisallowedInteropLibraryInDart2Wasm/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropEnclosingClassJSAnnotation/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExportClassNotMarkedExportable/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExportDartInterfaceHasNonEmptyJSExportValue/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExportDisallowedMember/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExportInvalidInteropTypeArgument/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExportInvalidTypeArgument/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExportMemberCollision/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExportNoExportableMembers/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExtensionTypeMemberNotInterop/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExtensionTypeNotInterop/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExtensionTypeUsedWithWrongJsAnnotation/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExternalExtensionMemberOnTypeInvalid/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExternalExtensionMemberWithStaticDisallowed/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropExternalMemberNotJSAnnotated/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropFunctionToJSNamedParameters/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropFunctionToJSRequiresStaticType/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropFunctionToJSTypeParameters/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropInvalidStaticClassMemberName/analyzerCode: missingAnalyzerCode -JsInteropIsAInvalidTypeVariable/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropIsAObjectLiteralType/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropIsAPrimitiveExtensionType/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropIsATearoff/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropJSClassExtendsDartClass/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropNamedParameters/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropNativeClassInAnnotation/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropNonExternalConstructor/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropNonExternalMember/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropNonStaticWithStaticInteropSupertype/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropObjectLiteralConstructorPositionalParameters/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropOperatorCannotBeRenamed/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropOperatorsNotSupported/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropExternalAccessorTypeViolation/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropExternalFunctionTypeViolation/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropGenerativeConstructor/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropMockMissingGetterOrSetter/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropMockMissingImplements/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropMockNotStaticInteropType/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropMockTypeParametersNotAllowed/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropNoJSAnnotation/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropParameterInitializersAreIgnored/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropSyntheticConstructor/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropTearOffsDisallowed/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropToJSFunctionTypeViolation/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropTrustTypesUsageNotAllowed/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropTrustTypesUsedWithoutStaticInterop/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropWithInstanceMembers/analyzerCode: missingAnalyzerCode # Web compiler specific -JsInteropStaticInteropWithNonStaticSupertype/analyzerCode: missingAnalyzerCode # Web compiler specific -LanguageVersionInvalidInDotPackages/analyzerCode: missingAnalyzerCode -LanguageVersionMismatchInPart/analyzerCode: missingAnalyzerCode -LanguageVersionMismatchInPatch/analyzerCode: missingAnalyzerCode -LanguageVersionTooHighExplicit/analyzerCode: missingAnalyzerCode -LanguageVersionTooHighPackage/analyzerCode: missingAnalyzerCode -LanguageVersionTooLowExplicit/analyzerCode: missingAnalyzerCode -LanguageVersionTooLowPackage/analyzerCode: missingAnalyzerCode -LateDefinitelyAssignedError/analyzerCode: missingAnalyzerCode -LateDefinitelyUnassignedError/analyzerCode: missingAnalyzerCode -MainNotFunctionDeclaration/analyzerCode: missingAnalyzerCode -MainNotFunctionDeclarationExported/analyzerCode: missingAnalyzerCode -MainRequiredNamedParameters/analyzerCode: missingAnalyzerCode -MainRequiredNamedParametersExported/analyzerCode: missingAnalyzerCode -MainTooManyRequiredParameters/analyzerCode: missingAnalyzerCode -MainTooManyRequiredParametersExported/analyzerCode: missingAnalyzerCode -MainWrongParameterType/analyzerCode: missingAnalyzerCode -MainWrongParameterTypeExported/analyzerCode: missingAnalyzerCode -MemberShouldBeListedAsCallableInDynamicInterface/analyzerCode: missingAnalyzerCode -MemberShouldBeListedAsCanBeOverriddenInDynamicInterface/analyzerCode: missingAnalyzerCode -MissingInput/analyzerCode: missingAnalyzerCode -MissingMain/analyzerCode: missingAnalyzerCode -NamedMixinOverride/analyzerCode: missingAnalyzerCode -NamedParametersInExtensionTypeDeclaration/analyzerCode: missingAnalyzerCode -NameNotFoundInRecordNameGet/analyzerCode: missingAnalyzerCode -NegativeVariableDimension/analyzerCode: missingAnalyzerCode -NeverReachableSwitchDefaultError/analyzerCode: missingAnalyzerCode -NeverReachableSwitchExpressionError/analyzerCode: missingAnalyzerCode -NeverReachableSwitchStatementError/analyzerCode: missingAnalyzerCode -NeverValueError/analyzerCode: missingAnalyzerCode -NewAsSelector/analyzerCode: missingAnalyzerCode -NoAugmentSuperInvokeTarget/analyzerCode: missingAnalyzerCode -NoAugmentSuperReadTarget/analyzerCode: missingAnalyzerCode -NoAugmentSuperWriteTarget/analyzerCode: missingAnalyzerCode -NonCovariantTypeParameterInRepresentationType/analyzerCode: missingAnalyzerCode -NonNullableNotAssignedError/analyzerCode: missingAnalyzerCode -NonNullAwareSpreadIsNull/analyzerCode: missingAnalyzerCode # There's no analyzer code for that error yet. -NonPositiveArrayDimensions/analyzerCode: missingAnalyzerCode -NotBinaryOperator/analyzerCode: missingAnalyzerCode -NoUnnamedConstructorInObject/analyzerCode: missingAnalyzerCode -NullableExpressionCallError/analyzerCode: missingAnalyzerCode -NullableInterfaceError/analyzerCode: missingAnalyzerCode -NullableMethodCallError/analyzerCode: missingAnalyzerCode -NullableMixinError/analyzerCode: missingAnalyzerCode -NullableOperatorCallError/analyzerCode: missingAnalyzerCode -NullablePropertyAccessError/analyzerCode: missingAnalyzerCode -NullableSpreadError/analyzerCode: missingAnalyzerCode -NullableSuperclassError/analyzerCode: missingAnalyzerCode -NullableTearoffError/analyzerCode: missingAnalyzerCode -ObjectMemberNameUsedForRecordField/analyzerCode: missingAnalyzerCode -ObsoleteColonForDefaultValue/analyzerCode: missingAnalyzerCode -OperatorParameterMismatch0/analyzerCode: missingAnalyzerCode -OperatorWithOptionalFormals/analyzerCode: missingAnalyzerCode -OptionalParametersInExtensionTypeDeclaration/analyzerCode: missingAnalyzerCode -OptionalSuperParameterWithoutInitializer/analyzerCode: missingAnalyzerCode -OverrideMismatchRequiredNamedParameter/analyzerCode: missingAnalyzerCode -OverrideTypeParametersBoundMismatch/analyzerCode: missingAnalyzerCode -PackageNotFound/analyzerCode: missingAnalyzerCode -PackagesFileFormat/analyzerCode: missingAnalyzerCode # Analyzer crashes when .packages file has format error -PartOrphan/analyzerCode: missingAnalyzerCode # Analyzer can't handle this situation -PatchClassTypeParametersMismatch/analyzerCode: missingAnalyzerCode -PatchExtensionTypeParametersMismatch/analyzerCode: missingAnalyzerCode -PatchInjectionFailed/analyzerCode: missingAnalyzerCode -PatternMatchingError/analyzerCode: missingAnalyzerCode -PositionalSuperParametersAndArguments/analyzerCode: missingAnalyzerCode -RecordUseCannotBePlacedHere/analyzerCode: missingAnalyzerCode -RecordUsedAsCallable/analyzerCode: missingAnalyzerCode -RequiredNamedParameterHasDefaultValueError/analyzerCode: missingAnalyzerCode -RestPatternInMapPattern/analyzerCode: missingAnalyzerCode -ReturnWithoutExpressionAsync/analyzerCode: missingAnalyzerCode -ReturnWithoutExpressionSync/analyzerCode: missingAnalyzerCode -ScriptTagInPartFile/analyzerCode: missingAnalyzerCode -SdkRootNotFound/analyzerCode: missingAnalyzerCode -SdkSpecificationNotFound/analyzerCode: missingAnalyzerCode -SdkSummaryNotFound/analyzerCode: missingAnalyzerCode -SetOrMapLiteralTooManyTypeArguments/analyzerCode: missingAnalyzerCode -SourceBodySummary/analyzerCode: missingAnalyzerCode -SourceOutlineSummary/analyzerCode: missingAnalyzerCode -SpreadMapEntryTypeMismatch/analyzerCode: missingAnalyzerCode # There's no analyzer code for that error yet. -SpreadTypeMismatch/analyzerCode: missingAnalyzerCode # There's no analyzer code for that error yet. -StaticTearOffFromInstantiatedClass/analyzerCode: missingAnalyzerCode -SuperExtensionTypeIsIllegal/analyzerCode: missingAnalyzerCode -SuperExtensionTypeIsIllegalAliased/analyzerCode: missingAnalyzerCode -SuperExtensionTypeIsNullableAliased/analyzerCode: missingAnalyzerCode -SuperExtensionTypeIsTypeParameter/analyzerCode: missingAnalyzerCode -SuperParameterInitializerOutsideConstructor/analyzerCode: missingAnalyzerCode -SupertypeIsFunction/analyzerCode: missingAnalyzerCode -SwitchExpressionNotSubtype/analyzerCode: missingAnalyzerCode -ThisAccessInFieldInitializer/analyzerCode: missingAnalyzerCode -ThisNotPromoted/analyzerCode: missingAnalyzerCode -ThrowingNotAssignableToObjectError/analyzerCode: missingAnalyzerCode -TypedefNullableType/analyzerCode: missingAnalyzerCode -TypedefTypeParameterNotConstructor/analyzerCode: missingAnalyzerCode # Feature not yet enabled by default. -UndefinedExtensionSetter/analyzerCode: missingAnalyzerCode -UnmatchedAugmentationClass/analyzerCode: missingAnalyzerCode -UnmatchedAugmentationClassMember/analyzerCode: missingAnalyzerCode -UnmatchedAugmentationConstructor/analyzerCode: missingAnalyzerCode -UnmatchedAugmentationDeclaration/analyzerCode: missingAnalyzerCode -UnmatchedAugmentationLibraryMember/analyzerCode: missingAnalyzerCode -UnmatchedPatchClass/analyzerCode: missingAnalyzerCode -UnmatchedPatchClassMember/analyzerCode: missingAnalyzerCode -UnmatchedPatchDeclaration/analyzerCode: missingAnalyzerCode -UnmatchedPatchLibraryMember/analyzerCode: missingAnalyzerCode -UnnamedObjectPatternField/analyzerCode: missingAnalyzerCode -UnsoundSwitchExpressionError/analyzerCode: missingAnalyzerCode -UnsoundSwitchStatementError/analyzerCode: missingAnalyzerCode -Unspecified/analyzerCode: missingAnalyzerCode -UnsupportedDartExt/analyzerCode: missingAnalyzerCode -UnterminatedToken/analyzerCode: missingAnalyzerCode # This is a fall-back message that shouldn't happen. -ValueForRequiredParameterNotProvidedError/analyzerCode: missingAnalyzerCode -VariableCouldBeNullDueToWrite/analyzerCode: missingAnalyzerCode -WasmImportOrExportInUserCode/analyzerCode: missingAnalyzerCode -WeakReferenceMismatchReturnAndArgumentTypes/analyzerCode: missingAnalyzerCode -WeakReferenceNotOneArgument/analyzerCode: missingAnalyzerCode -WeakReferenceNotStatic/analyzerCode: missingAnalyzerCode -WeakReferenceReturnTypeNotNullable/analyzerCode: missingAnalyzerCode -WeakReferenceTargetHasParameters/analyzerCode: missingAnalyzerCode -WeakReferenceTargetNotStaticTearoff/analyzerCode: missingAnalyzerCode -WebLiteralCannotBeRepresentedExactly/analyzerCode: missingAnalyzerCode +front_end/AbstractClassConstructorTearOff/analyzerCode: missingAnalyzerCode +front_end/AbstractFieldConstructorInitializer/analyzerCode: missingAnalyzerCode +front_end/AbstractFieldInitializer/analyzerCode: missingAnalyzerCode +front_end/AmbiguousExtensionMethod/analyzerCode: missingAnalyzerCode +front_end/AmbiguousExtensionOperator/analyzerCode: missingAnalyzerCode +front_end/AmbiguousExtensionProperty/analyzerCode: missingAnalyzerCode +front_end/AnnotationOnFunctionTypeTypeParameter/analyzerCode: missingAnalyzerCode +front_end/AssertAsExpression/analyzerCode: missingAnalyzerCode +front_end/AwaitInLateLocalInitializer/analyzerCode: missingAnalyzerCode +front_end/CannotAssignToConstVariable/analyzerCode: missingAnalyzerCode +front_end/CannotAssignToExtensionThis/analyzerCode: missingAnalyzerCode +front_end/CannotAssignToFinalVariable/analyzerCode: missingAnalyzerCode +front_end/CannotAssignToTypeLiteral/analyzerCode: missingAnalyzerCode +front_end/CannotReadSdkSpecification/analyzerCode: missingAnalyzerCode +front_end/CantDisambiguateAmbiguousInformation/analyzerCode: missingAnalyzerCode # There's no analyzer code for that error yet. +front_end/CantDisambiguateNotEnoughInformation/analyzerCode: missingAnalyzerCode # There's no analyzer code for that error yet. +front_end/CantHaveNamedParameters/analyzerCode: missingAnalyzerCode +front_end/CantHaveOptionalParameters/analyzerCode: missingAnalyzerCode +front_end/CantInferPackagesFromManyInputs/analyzerCode: missingAnalyzerCode +front_end/CantInferPackagesFromPackageUri/analyzerCode: missingAnalyzerCode +front_end/ClassShouldBeListedAsCallableInDynamicInterface/analyzerCode: missingAnalyzerCode +front_end/ClassShouldBeListedAsExtendableInDynamicInterface/analyzerCode: missingAnalyzerCode +front_end/ConstConstructorLateFinalFieldError/analyzerCode: missingAnalyzerCode +front_end/ConstConstructorRedirectionToNonConst/analyzerCode: missingAnalyzerCode # The analyzer doesn't report this error. +front_end/ConstEvalCaseImplementsEqual/analyzerCode: missingAnalyzerCode +front_end/ConstEvalElementNotPrimitiveEquality/analyzerCode: missingAnalyzerCode +front_end/ConstEvalEqualsOperandNotPrimitiveEquality/analyzerCode: missingAnalyzerCode +front_end/ConstEvalError/analyzerCode: missingAnalyzerCode +front_end/ConstEvalExternalConstructor/analyzerCode: missingAnalyzerCode +front_end/ConstEvalExternalFactory/analyzerCode: missingAnalyzerCode +front_end/ConstEvalGetterNotFound/analyzerCode: missingAnalyzerCode +front_end/ConstEvalInvalidBinaryOperandType/analyzerCode: missingAnalyzerCode # CONST_EVAL_TYPE_NUM / CONST_EVAL_TYPE_BOOL +front_end/ConstEvalInvalidEqualsOperandType/analyzerCode: missingAnalyzerCode +front_end/ConstEvalInvalidType/analyzerCode: missingAnalyzerCode # CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH / CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH / CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH / ... +front_end/ConstEvalKeyNotPrimitiveEquality/analyzerCode: missingAnalyzerCode +front_end/ConstEvalNegativeShift/analyzerCode: missingAnalyzerCode +front_end/ConstEvalNonNull/analyzerCode: missingAnalyzerCode +front_end/ConstEvalStartingPoint/analyzerCode: missingAnalyzerCode # This is just used for displaying the starting point. +front_end/ConstEvalTruncateError/analyzerCode: missingAnalyzerCode +front_end/ConstEvalUnevaluated/analyzerCode: missingAnalyzerCode +front_end/ConstEvalUnhandledCoreException/analyzerCode: missingAnalyzerCode +front_end/ConstEvalUnhandledException/analyzerCode: missingAnalyzerCode +front_end/ConstructorShouldBeListedAsCallableInDynamicInterface/analyzerCode: missingAnalyzerCode +front_end/ConstructorTearOffWithTypeArguments/analyzerCode: missingAnalyzerCode +front_end/CouldNotParseUri/analyzerCode: missingAnalyzerCode +front_end/CyclicRepresentationDependency/analyzerCode: missingAnalyzerCode +front_end/DartFfiLibraryInDart2Wasm/analyzerCode: missingAnalyzerCode +front_end/DeferredExtensionImport/analyzerCode: missingAnalyzerCode +front_end/DillOutlineSummary/analyzerCode: missingAnalyzerCode +front_end/DotShorthandsConstructorInvocationWithTypeArguments/analyzerCode: missingAnalyzerCode # TODO(kallentu): https://github.com/dart-lang/sdk/issues/59835 +front_end/DotShorthandsInvalidContext/analyzerCode: missingAnalyzerCode # TODO(kallentu): https://github.com/dart-lang/sdk/issues/59835 +front_end/DotShorthandsUndefinedGetter/analyzerCode: missingAnalyzerCode # TODO(kallentu): https://github.com/dart-lang/sdk/issues/59835 +front_end/DotShorthandsUndefinedInvocation/analyzerCode: missingAnalyzerCode # TODO(kallentu): https://github.com/dart-lang/sdk/issues/59835 +front_end/DuplicatedDeclarationUse/analyzerCode: missingAnalyzerCode # No corresponding analyzer code. +front_end/DuplicatedRecordLiteralFieldName/analyzerCode: missingAnalyzerCode +front_end/DuplicatedRecordTypeFieldName/analyzerCode: missingAnalyzerCode +front_end/DynamicCallsAreNotAllowedInDynamicModule/analyzerCode: missingAnalyzerCode +front_end/Encoding/analyzerCode: missingAnalyzerCode +front_end/EnumAbstractMember/analyzerCode: missingAnalyzerCode +front_end/EnumConstructorSuperInitializer/analyzerCode: missingAnalyzerCode +front_end/EnumConstructorTearoff/analyzerCode: missingAnalyzerCode +front_end/EnumContainsRestrictedInstanceDeclaration/analyzerCode: missingAnalyzerCode +front_end/EnumContainsValuesDeclaration/analyzerCode: missingAnalyzerCode +front_end/EnumFactoryRedirectsToConstructor/analyzerCode: missingAnalyzerCode +front_end/EnumImplementerContainsRestrictedInstanceDeclaration/analyzerCode: missingAnalyzerCode +front_end/EnumImplementerContainsValuesDeclaration/analyzerCode: missingAnalyzerCode +front_end/EnumInheritsRestricted/analyzerCode: missingAnalyzerCode +front_end/EnumNonConstConstructor/analyzerCode: missingAnalyzerCode +front_end/EnumSupertypeOfNonAbstractClass/analyzerCode: missingAnalyzerCode +front_end/ExceptionReadingFile/analyzerCode: missingAnalyzerCode +front_end/ExpectedOneExpression/analyzerCode: missingAnalyzerCode +front_end/ExpectedUri/analyzerCode: missingAnalyzerCode +front_end/ExperimentExpiredDisabled/analyzerCode: missingAnalyzerCode +front_end/ExperimentExpiredEnabled/analyzerCode: missingAnalyzerCode +front_end/ExperimentOptOutExplicit/analyzerCode: missingAnalyzerCode +front_end/ExperimentOptOutImplicit/analyzerCode: missingAnalyzerCode +front_end/ExplicitExtensionArgumentMismatch/analyzerCode: missingAnalyzerCode +front_end/ExplicitExtensionAsExpression/analyzerCode: missingAnalyzerCode +front_end/ExplicitExtensionAsLvalue/analyzerCode: missingAnalyzerCode +front_end/ExplicitExtensionTypeArgumentMismatch/analyzerCode: missingAnalyzerCode +front_end/ExpressionEvaluationKnownVariableUnavailable/analyzerCode: missingAnalyzerCode +front_end/ExpressionNotMetadata/analyzerCode: missingAnalyzerCode +front_end/ExtendsNever/analyzerCode: missingAnalyzerCode # Feature not yet in analyzer. +front_end/ExtensionMemberConflictsWithObjectMember/analyzerCode: missingAnalyzerCode +front_end/ExtensionTypePrimaryConstructorFunctionFormalParameterSyntax/analyzerCode: missingAnalyzerCode +front_end/ExtensionTypePrimaryConstructorWithInitializingFormal/analyzerCode: missingAnalyzerCode +front_end/ExtensionTypeShouldBeListedAsCallableInDynamicInterface/analyzerCode: missingAnalyzerCode +front_end/ExternalFieldConstructorInitializer/analyzerCode: missingAnalyzerCode +front_end/ExternalFieldInitializer/analyzerCode: missingAnalyzerCode +front_end/FastaCLIArgumentRequired/analyzerCode: missingAnalyzerCode +front_end/FastaUsageLong/analyzerCode: missingAnalyzerCode +front_end/FastaUsageShort/analyzerCode: missingAnalyzerCode +front_end/FfiAbiSpecificIntegerInvalid/analyzerCode: missingAnalyzerCode +front_end/FfiAbiSpecificIntegerMappingInvalid/analyzerCode: missingAnalyzerCode +front_end/FfiAddressPosition/analyzerCode: missingAnalyzerCode +front_end/FfiAddressReceiver/analyzerCode: missingAnalyzerCode +front_end/FfiCompoundImplementsFinalizable/analyzerCode: missingAnalyzerCode +front_end/FfiCreateOfStructOrUnion/analyzerCode: missingAnalyzerCode +front_end/FfiDartTypeMismatch/analyzerCode: missingAnalyzerCode +front_end/FfiDeeplyImmutableClassesMustBeFinalOrSealed/analyzerCode: missingAnalyzerCode +front_end/FfiDeeplyImmutableFieldsModifiers/analyzerCode: missingAnalyzerCode +front_end/FfiDeeplyImmutableFieldsMustBeDeeplyImmutable/analyzerCode: missingAnalyzerCode +front_end/FfiDeeplyImmutableSubtypesMustBeDeeplyImmutable/analyzerCode: missingAnalyzerCode +front_end/FfiDeeplyImmutableSupertypeMustBeDeeplyImmutable/analyzerCode: missingAnalyzerCode +front_end/FfiEmptyStruct/analyzerCode: missingAnalyzerCode +front_end/FfiExceptionalReturnNull/analyzerCode: missingAnalyzerCode +front_end/FfiExpectedConstant/analyzerCode: missingAnalyzerCode +front_end/FfiExpectedConstantArg/analyzerCode: missingAnalyzerCode +front_end/FfiExpectedExceptionalReturn/analyzerCode: missingAnalyzerCode +front_end/FfiExpectedNoExceptionalReturn/analyzerCode: missingAnalyzerCode +front_end/FfiExtendsOrImplementsSealedClass/analyzerCode: missingAnalyzerCode +front_end/FfiFieldAnnotation/analyzerCode: missingAnalyzerCode +front_end/FfiFieldCyclic/analyzerCode: missingAnalyzerCode +front_end/FfiFieldInitializer/analyzerCode: missingAnalyzerCode +front_end/FfiFieldNoAnnotation/analyzerCode: missingAnalyzerCode +front_end/FfiFieldNull/analyzerCode: missingAnalyzerCode +front_end/FfiLeafCallMustNotReturnHandle/analyzerCode: missingAnalyzerCode +front_end/FfiLeafCallMustNotTakeHandle/analyzerCode: missingAnalyzerCode +front_end/FfiNativeCallableListenerReturnVoid/analyzerCode: missingAnalyzerCode +front_end/FfiNativeMustBeExternal/analyzerCode: missingAnalyzerCode +front_end/FfiNativeOnlyNativeFieldWrapperClassCanBePointer/analyzerCode: missingAnalyzerCode +front_end/FfiNativeUnexpectedNumberOfParameters/analyzerCode: missingAnalyzerCode +front_end/FfiNativeUnexpectedNumberOfParametersWithReceiver/analyzerCode: missingAnalyzerCode +front_end/FfiNotStatic/analyzerCode: missingAnalyzerCode +front_end/FfiPackedAnnotation/analyzerCode: missingAnalyzerCode +front_end/FfiPackedAnnotationAlignment/analyzerCode: missingAnalyzerCode +front_end/FfiSizeAnnotation/analyzerCode: missingAnalyzerCode +front_end/FfiSizeAnnotationDimensions/analyzerCode: missingAnalyzerCode +front_end/FfiStructGeneric/analyzerCode: missingAnalyzerCode +front_end/FfiTypeInvalid/analyzerCode: missingAnalyzerCode +front_end/FfiTypeMismatch/analyzerCode: missingAnalyzerCode +front_end/FfiVariableLengthArrayNotLast/analyzerCode: missingAnalyzerCode +front_end/FieldNonNullableNotInitializedByConstructorError/analyzerCode: missingAnalyzerCode +front_end/FieldNonNullableWithoutInitializerError/analyzerCode: missingAnalyzerCode +front_end/FieldNotPromotedBecauseConflictingField/analyzerCode: missingAnalyzerCode +front_end/FieldNotPromotedBecauseConflictingGetter/analyzerCode: missingAnalyzerCode +front_end/FieldNotPromotedBecauseConflictingNsmForwarder/analyzerCode: missingAnalyzerCode +front_end/FieldNotPromotedBecauseExternal/analyzerCode: missingAnalyzerCode +front_end/FieldNotPromotedBecauseNotEnabled/analyzerCode: missingAnalyzerCode +front_end/FieldNotPromotedBecauseNotField/analyzerCode: missingAnalyzerCode +front_end/FieldNotPromotedBecauseNotFinal/analyzerCode: missingAnalyzerCode +front_end/FieldNotPromotedBecauseNotPrivate/analyzerCode: missingAnalyzerCode +front_end/ForInLoopExactlyOneVariable/analyzerCode: missingAnalyzerCode # The analyzer doesn't recover well. +front_end/ForInLoopNotAssignable/analyzerCode: missingAnalyzerCode # The analyzer reports a different error. +front_end/IllegalAsyncGeneratorVoidReturnType/analyzerCode: missingAnalyzerCode # The analyzer doesn't report this error. +front_end/IllegalSyncGeneratorVoidReturnType/analyzerCode: missingAnalyzerCode # The analyzer doesn't report this error. +front_end/ImplementMultipleExtensionTypeMembers/analyzerCode: missingAnalyzerCode +front_end/ImplementNonExtensionTypeAndExtensionTypeMember/analyzerCode: missingAnalyzerCode +front_end/ImplementsFutureOr/analyzerCode: missingAnalyzerCode # The analyzer doesn't report this error. +front_end/ImplementsNever/analyzerCode: missingAnalyzerCode # Feature not yet in analyzer. +front_end/ImplicitMixinOverride/analyzerCode: missingAnalyzerCode +front_end/ImplicitReturnNull/analyzerCode: missingAnalyzerCode +front_end/IncrementalCompilerIllegalParameter/analyzerCode: missingAnalyzerCode +front_end/IncrementalCompilerIllegalTypeParameter/analyzerCode: missingAnalyzerCode +front_end/IndexOutOfBoundInRecordIndexGet/analyzerCode: missingAnalyzerCode +front_end/InputFileNotFound/analyzerCode: missingAnalyzerCode +front_end/InstantiationNonGenericFunctionType/analyzerCode: missingAnalyzerCode +front_end/InstantiationTooFewArguments/analyzerCode: missingAnalyzerCode +front_end/InstantiationTooManyArguments/analyzerCode: missingAnalyzerCode +front_end/InterfaceCheck/analyzerCode: missingAnalyzerCode +front_end/InvalidAugmentSuper/analyzerCode: missingAnalyzerCode +front_end/InvalidBreakTarget/analyzerCode: missingAnalyzerCode +front_end/InvalidContinueTarget/analyzerCode: missingAnalyzerCode +front_end/InvalidExtensionTypeSuperExtensionType/analyzerCode: missingAnalyzerCode +front_end/InvalidExtensionTypeSuperInterface/analyzerCode: missingAnalyzerCode +front_end/InvalidGetterSetterType/analyzerCode: missingAnalyzerCode +front_end/InvalidGetterSetterTypeBothInheritedField/analyzerCode: missingAnalyzerCode +front_end/InvalidGetterSetterTypeBothInheritedGetter/analyzerCode: missingAnalyzerCode +front_end/InvalidGetterSetterTypeFieldInherited/analyzerCode: missingAnalyzerCode +front_end/InvalidGetterSetterTypeGetterInherited/analyzerCode: missingAnalyzerCode +front_end/InvalidGetterSetterTypeSetterInheritedField/analyzerCode: missingAnalyzerCode +front_end/InvalidGetterSetterTypeSetterInheritedGetter/analyzerCode: missingAnalyzerCode +front_end/InvalidPackageUri/analyzerCode: missingAnalyzerCode +front_end/InvalidReturn/analyzerCode: missingAnalyzerCode +front_end/InvalidReturnAsync/analyzerCode: missingAnalyzerCode +front_end/InvalidTypeParameterInSupertype/analyzerCode: missingAnalyzerCode +front_end/InvalidTypeParameterInSupertypeWithVariance/analyzerCode: missingAnalyzerCode +front_end/InvalidTypeParameterVariancePosition/analyzerCode: missingAnalyzerCode +front_end/InvalidTypeParameterVariancePositionInReturnType/analyzerCode: missingAnalyzerCode +front_end/JointPatternVariablesMismatch/analyzerCode: missingAnalyzerCode +front_end/JsInteropDartClassExtendsJSClass/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropDartJsInteropAnnotationForStaticInteropOnly/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropDisallowedInteropLibraryInDart2Wasm/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropEnclosingClassJSAnnotation/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExportClassNotMarkedExportable/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExportDartInterfaceHasNonEmptyJSExportValue/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExportDisallowedMember/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExportInvalidInteropTypeArgument/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExportInvalidTypeArgument/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExportMemberCollision/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExportNoExportableMembers/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExtensionTypeMemberNotInterop/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExtensionTypeNotInterop/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExtensionTypeUsedWithWrongJsAnnotation/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExternalExtensionMemberOnTypeInvalid/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExternalExtensionMemberWithStaticDisallowed/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropExternalMemberNotJSAnnotated/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropFunctionToJSNamedParameters/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropFunctionToJSRequiresStaticType/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropFunctionToJSTypeParameters/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropInvalidStaticClassMemberName/analyzerCode: missingAnalyzerCode +front_end/JsInteropIsAInvalidTypeVariable/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropIsAObjectLiteralType/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropIsAPrimitiveExtensionType/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropIsATearoff/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropJSClassExtendsDartClass/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropNamedParameters/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropNativeClassInAnnotation/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropNonExternalConstructor/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropNonExternalMember/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropNonStaticWithStaticInteropSupertype/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropObjectLiteralConstructorPositionalParameters/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropOperatorCannotBeRenamed/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropOperatorsNotSupported/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropExternalAccessorTypeViolation/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropExternalFunctionTypeViolation/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropGenerativeConstructor/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropMockMissingGetterOrSetter/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropMockMissingImplements/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropMockNotStaticInteropType/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropMockTypeParametersNotAllowed/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropNoJSAnnotation/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropParameterInitializersAreIgnored/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropSyntheticConstructor/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropTearOffsDisallowed/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropToJSFunctionTypeViolation/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropTrustTypesUsageNotAllowed/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropTrustTypesUsedWithoutStaticInterop/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropWithInstanceMembers/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/JsInteropStaticInteropWithNonStaticSupertype/analyzerCode: missingAnalyzerCode # Web compiler specific +front_end/LanguageVersionInvalidInDotPackages/analyzerCode: missingAnalyzerCode +front_end/LanguageVersionMismatchInPart/analyzerCode: missingAnalyzerCode +front_end/LanguageVersionMismatchInPatch/analyzerCode: missingAnalyzerCode +front_end/LanguageVersionTooHighExplicit/analyzerCode: missingAnalyzerCode +front_end/LanguageVersionTooHighPackage/analyzerCode: missingAnalyzerCode +front_end/LanguageVersionTooLowExplicit/analyzerCode: missingAnalyzerCode +front_end/LanguageVersionTooLowPackage/analyzerCode: missingAnalyzerCode +front_end/LateDefinitelyAssignedError/analyzerCode: missingAnalyzerCode +front_end/LateDefinitelyUnassignedError/analyzerCode: missingAnalyzerCode +front_end/MainNotFunctionDeclaration/analyzerCode: missingAnalyzerCode +front_end/MainNotFunctionDeclarationExported/analyzerCode: missingAnalyzerCode +front_end/MainRequiredNamedParameters/analyzerCode: missingAnalyzerCode +front_end/MainRequiredNamedParametersExported/analyzerCode: missingAnalyzerCode +front_end/MainTooManyRequiredParameters/analyzerCode: missingAnalyzerCode +front_end/MainTooManyRequiredParametersExported/analyzerCode: missingAnalyzerCode +front_end/MainWrongParameterType/analyzerCode: missingAnalyzerCode +front_end/MainWrongParameterTypeExported/analyzerCode: missingAnalyzerCode +front_end/MemberShouldBeListedAsCallableInDynamicInterface/analyzerCode: missingAnalyzerCode +front_end/MemberShouldBeListedAsCanBeOverriddenInDynamicInterface/analyzerCode: missingAnalyzerCode +front_end/MissingInput/analyzerCode: missingAnalyzerCode +front_end/MissingMain/analyzerCode: missingAnalyzerCode +front_end/NamedMixinOverride/analyzerCode: missingAnalyzerCode +front_end/NamedParametersInExtensionTypeDeclaration/analyzerCode: missingAnalyzerCode +front_end/NameNotFoundInRecordNameGet/analyzerCode: missingAnalyzerCode +front_end/NegativeVariableDimension/analyzerCode: missingAnalyzerCode +front_end/NeverReachableSwitchDefaultError/analyzerCode: missingAnalyzerCode +front_end/NeverReachableSwitchExpressionError/analyzerCode: missingAnalyzerCode +front_end/NeverReachableSwitchStatementError/analyzerCode: missingAnalyzerCode +front_end/NeverValueError/analyzerCode: missingAnalyzerCode +front_end/NewAsSelector/analyzerCode: missingAnalyzerCode +front_end/NoAugmentSuperInvokeTarget/analyzerCode: missingAnalyzerCode +front_end/NoAugmentSuperReadTarget/analyzerCode: missingAnalyzerCode +front_end/NoAugmentSuperWriteTarget/analyzerCode: missingAnalyzerCode +front_end/NonCovariantTypeParameterInRepresentationType/analyzerCode: missingAnalyzerCode +front_end/NonNullableNotAssignedError/analyzerCode: missingAnalyzerCode +front_end/NonNullAwareSpreadIsNull/analyzerCode: missingAnalyzerCode # There's no analyzer code for that error yet. +front_end/NonPositiveArrayDimensions/analyzerCode: missingAnalyzerCode +front_end/NotBinaryOperator/analyzerCode: missingAnalyzerCode +front_end/NoUnnamedConstructorInObject/analyzerCode: missingAnalyzerCode +front_end/NullableExpressionCallError/analyzerCode: missingAnalyzerCode +front_end/NullableInterfaceError/analyzerCode: missingAnalyzerCode +front_end/NullableMethodCallError/analyzerCode: missingAnalyzerCode +front_end/NullableMixinError/analyzerCode: missingAnalyzerCode +front_end/NullableOperatorCallError/analyzerCode: missingAnalyzerCode +front_end/NullablePropertyAccessError/analyzerCode: missingAnalyzerCode +front_end/NullableSpreadError/analyzerCode: missingAnalyzerCode +front_end/NullableSuperclassError/analyzerCode: missingAnalyzerCode +front_end/NullableTearoffError/analyzerCode: missingAnalyzerCode +front_end/ObjectMemberNameUsedForRecordField/analyzerCode: missingAnalyzerCode +front_end/ObsoleteColonForDefaultValue/analyzerCode: missingAnalyzerCode +front_end/OperatorParameterMismatch0/analyzerCode: missingAnalyzerCode +front_end/OperatorWithOptionalFormals/analyzerCode: missingAnalyzerCode +front_end/OptionalParametersInExtensionTypeDeclaration/analyzerCode: missingAnalyzerCode +front_end/OptionalSuperParameterWithoutInitializer/analyzerCode: missingAnalyzerCode +front_end/OverrideMismatchRequiredNamedParameter/analyzerCode: missingAnalyzerCode +front_end/OverrideTypeParametersBoundMismatch/analyzerCode: missingAnalyzerCode +front_end/PackageNotFound/analyzerCode: missingAnalyzerCode +front_end/PackagesFileFormat/analyzerCode: missingAnalyzerCode # Analyzer crashes when .packages file has format error +front_end/PartOrphan/analyzerCode: missingAnalyzerCode # Analyzer can't handle this situation +front_end/PatchClassTypeParametersMismatch/analyzerCode: missingAnalyzerCode +front_end/PatchExtensionTypeParametersMismatch/analyzerCode: missingAnalyzerCode +front_end/PatchInjectionFailed/analyzerCode: missingAnalyzerCode +front_end/PatternMatchingError/analyzerCode: missingAnalyzerCode +front_end/PositionalSuperParametersAndArguments/analyzerCode: missingAnalyzerCode +front_end/RecordUseCannotBePlacedHere/analyzerCode: missingAnalyzerCode +front_end/RecordUsedAsCallable/analyzerCode: missingAnalyzerCode +front_end/RequiredNamedParameterHasDefaultValueError/analyzerCode: missingAnalyzerCode +front_end/RestPatternInMapPattern/analyzerCode: missingAnalyzerCode +front_end/ReturnWithoutExpressionAsync/analyzerCode: missingAnalyzerCode +front_end/ReturnWithoutExpressionSync/analyzerCode: missingAnalyzerCode +front_end/ScriptTagInPartFile/analyzerCode: missingAnalyzerCode +front_end/SdkRootNotFound/analyzerCode: missingAnalyzerCode +front_end/SdkSpecificationNotFound/analyzerCode: missingAnalyzerCode +front_end/SdkSummaryNotFound/analyzerCode: missingAnalyzerCode +front_end/SetOrMapLiteralTooManyTypeArguments/analyzerCode: missingAnalyzerCode +front_end/SourceBodySummary/analyzerCode: missingAnalyzerCode +front_end/SourceOutlineSummary/analyzerCode: missingAnalyzerCode +front_end/SpreadMapEntryTypeMismatch/analyzerCode: missingAnalyzerCode # There's no analyzer code for that error yet. +front_end/SpreadTypeMismatch/analyzerCode: missingAnalyzerCode # There's no analyzer code for that error yet. +front_end/StaticTearOffFromInstantiatedClass/analyzerCode: missingAnalyzerCode +front_end/SuperExtensionTypeIsIllegal/analyzerCode: missingAnalyzerCode +front_end/SuperExtensionTypeIsIllegalAliased/analyzerCode: missingAnalyzerCode +front_end/SuperExtensionTypeIsNullableAliased/analyzerCode: missingAnalyzerCode +front_end/SuperExtensionTypeIsTypeParameter/analyzerCode: missingAnalyzerCode +front_end/SuperParameterInitializerOutsideConstructor/analyzerCode: missingAnalyzerCode +front_end/SupertypeIsFunction/analyzerCode: missingAnalyzerCode +front_end/SwitchExpressionNotSubtype/analyzerCode: missingAnalyzerCode +front_end/ThisAccessInFieldInitializer/analyzerCode: missingAnalyzerCode +front_end/ThisNotPromoted/analyzerCode: missingAnalyzerCode +front_end/ThrowingNotAssignableToObjectError/analyzerCode: missingAnalyzerCode +front_end/TypedefNullableType/analyzerCode: missingAnalyzerCode +front_end/TypedefTypeParameterNotConstructor/analyzerCode: missingAnalyzerCode # Feature not yet enabled by default. +front_end/UndefinedExtensionSetter/analyzerCode: missingAnalyzerCode +front_end/UnmatchedAugmentationClass/analyzerCode: missingAnalyzerCode +front_end/UnmatchedAugmentationClassMember/analyzerCode: missingAnalyzerCode +front_end/UnmatchedAugmentationConstructor/analyzerCode: missingAnalyzerCode +front_end/UnmatchedAugmentationDeclaration/analyzerCode: missingAnalyzerCode +front_end/UnmatchedAugmentationLibraryMember/analyzerCode: missingAnalyzerCode +front_end/UnmatchedPatchClass/analyzerCode: missingAnalyzerCode +front_end/UnmatchedPatchClassMember/analyzerCode: missingAnalyzerCode +front_end/UnmatchedPatchDeclaration/analyzerCode: missingAnalyzerCode +front_end/UnmatchedPatchLibraryMember/analyzerCode: missingAnalyzerCode +front_end/UnnamedObjectPatternField/analyzerCode: missingAnalyzerCode +front_end/UnsoundSwitchExpressionError/analyzerCode: missingAnalyzerCode +front_end/UnsoundSwitchStatementError/analyzerCode: missingAnalyzerCode +front_end/Unspecified/analyzerCode: missingAnalyzerCode +front_end/UnsupportedDartExt/analyzerCode: missingAnalyzerCode +front_end/UnterminatedToken/analyzerCode: missingAnalyzerCode # This is a fall-back message that shouldn't happen. +front_end/ValueForRequiredParameterNotProvidedError/analyzerCode: missingAnalyzerCode +front_end/VariableCouldBeNullDueToWrite/analyzerCode: missingAnalyzerCode +front_end/WasmImportOrExportInUserCode/analyzerCode: missingAnalyzerCode +front_end/WeakReferenceMismatchReturnAndArgumentTypes/analyzerCode: missingAnalyzerCode +front_end/WeakReferenceNotOneArgument/analyzerCode: missingAnalyzerCode +front_end/WeakReferenceNotStatic/analyzerCode: missingAnalyzerCode +front_end/WeakReferenceReturnTypeNotNullable/analyzerCode: missingAnalyzerCode +front_end/WeakReferenceTargetHasParameters/analyzerCode: missingAnalyzerCode +front_end/WeakReferenceTargetNotStaticTearoff/analyzerCode: missingAnalyzerCode +front_end/WebLiteralCannotBeRepresentedExactly/analyzerCode: missingAnalyzerCode
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml index 6c3b36e..2829c3d 100644 --- a/pkg/front_end/messages.yaml +++ b/pkg/front_end/messages.yaml
@@ -767,28 +767,6 @@ problemMessage: "Unable to decode bytes as UTF-8." bytes: [255] -ExperimentNotEnabled: - parameters: - String string: undocumented - String string2: undocumented - index: 48 - problemMessage: "This requires the '#string' language feature to be enabled." - correctionMessage: "Try updating your pubspec.yaml to set the minimum SDK constraint to #string2 or higher, and running 'pub get'." - analyzerCode: ParserErrorCode.EXPERIMENT_NOT_ENABLED - -ExperimentNotEnabledOffByDefault: - parameters: - String string: undocumented - index: 133 - problemMessage: "This requires the experimental '#string' language feature to be enabled." - correctionMessage: "Try passing the '--enable-experiment=#string' command line option." - analyzerCode: ParserErrorCode.EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT - script: | - // @dart=3.5 - void foo() { - int i = 42_42_42_42; - } - ExperimentDisabled: parameters: String string: undocumented @@ -815,206 +793,6 @@ foo(); } -RecordLiteralOnePositionalFieldNoTrailingComma: - parameters: none - problemMessage: "A record literal with exactly one positional field requires a trailing comma." - correctionMessage: "Try adding a trailing comma." - analyzerCode: ParserErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA - index: 127 - hasPublishedDocs: true - documentation: |- - #### Description - - The analyzer produces this diagnostic when a record literal with a single - positional field doesn't have a trailing comma after the field. - - In some locations a record literal with a single positional field could - also be a parenthesized expression. A trailing comma is required to - disambiguate these two valid interpretations. - - #### Example - - The following code produces this diagnostic because the record literal has - one positional field but doesn't have a trailing comma: - - ```dart - var r = const (1[!)!]; - ``` - - #### Common fixes - - Add a trailing comma: - - ```dart - var r = const (1,); - ``` - script: | - main() { - var record = const (1); - } - -RecordLiteralZeroFieldsWithTrailingComma: - parameters: none - problemMessage: "A record literal without fields can't have a trailing comma." - correctionMessage: "Try removing the trailing comma." - analyzerCode: ParserErrorCode.EMPTY_RECORD_LITERAL_WITH_COMMA - index: 128 - hasPublishedDocs: true - documentation: |- - #### Description - - The analyzer produces this diagnostic when a record literal that has no - fields has a trailing comma. Empty record literals can't contain a comma. - - #### Example - - The following code produces this diagnostic because the empty record - literal has a trailing comma: - - ```dart - var r = ([!,!]); - ``` - - #### Common fixes - - If the record is intended to be empty, then remove the comma: - - ```dart - var r = (); - ``` - - If the record is intended to have one or more fields, then add the - expressions used to compute the values of those fields: - - ```dart - var r = (3, 4); - ``` - script: | - main() { - var record = (,); - } - -EmptyRecordTypeNamedFieldsList: - parameters: none - problemMessage: "The list of named fields in a record type can't be empty." - correctionMessage: "Try adding a named field to the list." - analyzerCode: ParserErrorCode.EMPTY_RECORD_TYPE_NAMED_FIELDS_LIST - index: 129 - hasPublishedDocs: true - documentation: |- - #### Description - - The analyzer produces this diagnostic when a record type has an empty list - of named fields. - - #### Example - - The following code produces this diagnostic because the record type has an - empty list of named fields: - - ```dart - void f((int, int, {[!}!]) r) {} - ``` - - #### Common fixes - - If the record is intended to have named fields, then add the types and - names of the fields: - - ```dart - void f((int, int, {int z}) r) {} - ``` - - If the record isn't intended to have named fields, then remove the curly - braces: - - ```dart - void f((int, int) r) {} - ``` - script: | - main() { - (int, int, {/*missing*/}) record = (1, 2,); - } - -RecordTypeZeroFieldsButTrailingComma: - parameters: none - problemMessage: "A record type without fields can't have a trailing comma." - correctionMessage: "Try removing the trailing comma." - analyzerCode: ParserErrorCode.EMPTY_RECORD_TYPE_WITH_COMMA - index: 130 - hasPublishedDocs: true - documentation: |- - #### Description - - The analyzer produces this diagnostic when a record type that has no - fields has a trailing comma. Empty record types can't contain a comma. - - #### Example - - The following code produces this diagnostic because the empty record type - has a trailing comma: - - ```dart - void f(([!,!]) r) {} - ``` - - #### Common fixes - - If the record type is intended to be empty, then remove the comma: - - ```dart - void f(() r) {} - ``` - - If the record type is intended to have one or more fields, then add the - types of those fields: - - ```dart - void f((int, int) r) {} - ``` - script: | - main() { - (,) record = (); - } - -RecordTypeOnePositionalFieldNoTrailingComma: - parameters: none - problemMessage: "A record type with exactly one positional field requires a trailing comma." - correctionMessage: "Try adding a trailing comma." - analyzerCode: ParserErrorCode.RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA - index: 131 - hasPublishedDocs: true - documentation: |- - #### Description - - The analyzer produces this diagnostic when a record type annotation with a - single positional field doesn't have a trailing comma after the field. - - In some locations a record type with a single positional field could also - be a parenthesized expression. A trailing comma is required to - disambiguate these two valid interpretations. - - #### Example - - The following code produces this diagnostic because the record type has - one positional field, but doesn't have a trailing comma: - - ```dart - void f((int[!)!] r) {} - ``` - - #### Common fixes - - Add a trailing comma: - - ```dart - void f((int,) r) {} - ``` - script: | - main() { - (int /* missing trailing comma */) record = const (1, ); - } - DuplicatedRecordTypeFieldName: parameters: Name name: undocumented @@ -1055,19 +833,6 @@ foo(); } -ExpectedElseOrComma: - parameters: none - index: 46 - problemMessage: "Expected 'else' or comma." - analyzerCode: ParserErrorCode.EXPECTED_ELSE_OR_COMMA - script: | - void foo(int i) { - var x = [ - if (i > 2) 2 - 2 - ]; - } - ExpectedBlockToSkip: parameters: none problemMessage: "Expected a function body or '=>'." @@ -1083,13 +848,6 @@ analyzerCode: MISSING_FUNCTION_BODY script: "main();" -ExpectedStatement: - parameters: none - index: 29 - problemMessage: "Expected a statement." - analyzerCode: ParserErrorCode.MISSING_STATEMENT - statement: "void;" - ExpectedButGot: # Also see ExpectedAfterButGot and ExpectedInstead parameters: @@ -1131,95 +889,6 @@ script: - "main() { return true }" -ExpectedInstead: - # Also see ExpectedButGot and ExpectedAfterButGot - parameters: - String string: undocumented - index: 41 - problemMessage: "Expected '#string' instead of this." - # This is an alternative to ExpectedButGot when the last consumed token - # should be replaced with a different token. - # - # For example, this is ok... - # - # mixin Foo extends Bar { - # ^^^^^^^ - # Expected 'on' before this - # - # but this is easier for the user... - # - # mixin Foo extends Bar { - # ^^^^^^^ - # Expected 'on' instead of this - # - analyzerCode: ParserErrorCode.EXPECTED_INSTEAD - script: - - "class B {} mixin A extends B { }" - -MultipleLibraryDirectives: - parameters: none - index: 27 - problemMessage: "Only one library directive may be declared in a file." - correctionMessage: "Try removing all but one of the library directives." - analyzerCode: ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES - script: - library foo; - library bar; - -MultipleExtends: - parameters: none - index: 28 - problemMessage: "Each class definition can have at most one extends clause." - correctionMessage: "Try choosing one superclass and define your class to implement (or mix in) the others." - analyzerCode: ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES - script: - - "class B{} class C{} class A extends B extends C {}" - - "class B{} class C{} class A extends B, C {}" - -MultipleWith: - parameters: none - index: 24 - problemMessage: "Each class definition can have at most one with clause." - correctionMessage: "Try combining all of the with clauses into a single clause." - analyzerCode: ParserErrorCode.MULTIPLE_WITH_CLAUSES - script: "class A extends B with C, D with E {}" - exampleAllowOtherCodes: true - -WithBeforeExtends: - parameters: none - index: 11 - problemMessage: "The extends clause must be before the with clause." - correctionMessage: "Try moving the extends clause before the with clause." - analyzerCode: ParserErrorCode.WITH_BEFORE_EXTENDS - script: "mixin B {} class C {} class A with B extends C {}" - -ImplementsBeforeExtends: - parameters: none - index: 44 - problemMessage: "The extends clause must be before the implements clause." - correctionMessage: "Try moving the extends clause before the implements clause." - analyzerCode: ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS - script: "class A implements B extends C {}" - exampleAllowOtherCodes: true - -ImplementsBeforeOn: - parameters: none - index: 43 - problemMessage: "The on clause must be before the implements clause." - correctionMessage: "Try moving the on clause before the implements clause." - analyzerCode: ParserErrorCode.IMPLEMENTS_BEFORE_ON - script: "mixin A implements B on C {}" - exampleAllowOtherCodes: true - -ImplementsBeforeWith: - parameters: none - index: 42 - problemMessage: "The with clause must be before the implements clause." - correctionMessage: "Try moving the with clause before the implements clause." - analyzerCode: ParserErrorCode.IMPLEMENTS_BEFORE_WITH - script: "class A extends B implements C with D {}" - exampleAllowOtherCodes: true - ImplementsRepeated: parameters: Name name: undocumented @@ -1252,44 +921,6 @@ script: "class A implements B implements C, D {}" exampleAllowOtherCodes: true -MultipleClauses: - parameters: - String string: undocumented - String string2: undocumented - problemMessage: "Each '#string' definition can have at most one '#string2' clause." - correctionMessage: "Try combining all of the '#string2' clauses into a single clause." - analyzerCode: ParserErrorCode.MULTIPLE_CLAUSES - index: 121 - script: - - "mixin B {} enum A implements B implements C, D { v; }" - - "mixin B {} enum A with B with C, D { v; }" - -OutOfOrderClauses: - parameters: - String string: undocumented - String string2: undocumented - problemMessage: "The '#string' clause must come before the '#string2' clause." - correctionMessage: "Try moving the '#string' clause before the '#string2' clause." - analyzerCode: ParserErrorCode.OUT_OF_ORDER_CLAUSES - index: 122 - script: "class B {} class D {} enum A implements B with D { v; }" - -MultipleOnClauses: - parameters: none - index: 26 - problemMessage: "Each mixin definition can have at most one on clause." - correctionMessage: "Try combining all of the on clauses into a single clause." - analyzerCode: ParserErrorCode.MULTIPLE_ON_CLAUSES - script: "mixin A on B on C, D {}" - exampleAllowOtherCodes: true - -MixinWithClause: - parameters: none - index: 154 - problemMessage: "A mixin can't have a with clause." - analyzerCode: ParserErrorCode.MIXIN_WITH_CLAUSE - script: "mixin M {} mixin N with M {}" - ImplementsFutureOr: parameters: none problemMessage: "The type 'FutureOr' can't be used in an 'implements' clause." @@ -1311,104 +942,6 @@ class Foo implements Never {} exampleAllowOtherCodes: true -ExpectedClassBody: - parameters: none - index: 8 - problemMessage: "A class declaration must have a body, even if it is empty." - correctionMessage: "Try adding an empty body." - analyzerCode: ParserErrorCode.EXPECTED_CLASS_BODY - sharedName: EXPECTED_BODY - script: | - class Class - -ExpectedMixinBody: - parameters: none - index: 166 - problemMessage: "A mixin declaration must have a body, even if it is empty." - correctionMessage: "Try adding an empty body." - analyzerCode: ParserErrorCode.EXPECTED_MIXIN_BODY - sharedName: EXPECTED_BODY - script: | - mixin Mixin - -ExpectedExtensionBody: - parameters: none - index: 173 - problemMessage: "An extension declaration must have a body, even if it is empty." - correctionMessage: "Try adding an empty body." - analyzerCode: ParserErrorCode.EXPECTED_EXTENSION_BODY - sharedName: EXPECTED_BODY - script: | - extension Extension on int - -ExpectedExtensionTypeBody: - parameters: none - index: 167 - problemMessage: "An extension type declaration must have a body, even if it is empty." - correctionMessage: "Try adding an empty body." - analyzerCode: ParserErrorCode.EXPECTED_EXTENSION_TYPE_BODY - sharedName: EXPECTED_BODY - script: | - extension type ExtensionType(int i) - -ExpectedTryStatementBody: - parameters: none - index: 168 - problemMessage: "A try statement must have a body, even if it is empty." - correctionMessage: "Try adding an empty body." - analyzerCode: ParserErrorCode.EXPECTED_TRY_STATEMENT_BODY - sharedName: EXPECTED_BODY - script: | - method() { - try finally {} - } - -ExpectedCatchClauseBody: - parameters: none - index: 169 - problemMessage: "A catch clause must have a body, even if it is empty." - correctionMessage: "Try adding an empty body." - analyzerCode: ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY - sharedName: EXPECTED_BODY - script: | - method() { - try {} catch (_); - } - -ExpectedFinallyClauseBody: - parameters: none - index: 170 - problemMessage: "A finally clause must have a body, even if it is empty." - correctionMessage: "Try adding an empty body." - analyzerCode: ParserErrorCode.EXPECTED_FINALLY_CLAUSE_BODY - sharedName: EXPECTED_BODY - script: | - method() { - try {} finally; - } - -ExpectedSwitchExpressionBody: - parameters: none - index: 171 - problemMessage: "A switch expression must have a body, even if it is empty." - correctionMessage: "Try adding an empty body." - analyzerCode: ParserErrorCode.EXPECTED_SWITCH_EXPRESSION_BODY - sharedName: EXPECTED_BODY - script: | - method(Never n) => switch (n); - -ExpectedSwitchStatementBody: - parameters: none - index: 172 - problemMessage: "A switch statement must have a body, even if it is empty." - correctionMessage: "Try adding an empty body." - analyzerCode: ParserErrorCode.EXPECTED_SWITCH_STATEMENT_BODY - sharedName: EXPECTED_BODY - script: | - method(Never n) { - switch (n); - } - ExpectedDeclaration: parameters: Token lexeme: undocumented @@ -1458,26 +991,6 @@ analyzerCode: MISSING_IDENTIFIER script: "var = 42;" -ExpectedIdentifierButGotKeyword: - parameters: - Token lexeme: undocumented - problemMessage: "'#lexeme' can't be used as an identifier because it's a keyword." - correctionMessage: "Try renaming this to be an identifier that isn't a keyword." - index: 113 - analyzerCode: ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD - script: "var default = 42;" - -EqualityCannotBeEqualityOperand: - parameters: none - index: 1 - problemMessage: "A comparison expression can't be an operand of another comparison expression." - correctionMessage: "Try putting parentheses around one of the comparisons." - analyzerCode: ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND - exampleAllowOtherCodes: true - script: - - "main() { var b = a < b < c; }" - - "main() { var b = a == b != c; }" - ExpectedString: parameters: Token lexeme: undocumented @@ -1508,80 +1021,6 @@ extension try<T> on Class<T> {} exampleAllowOtherCodes: true -VarAsTypeName: - parameters: none - index: 61 - problemMessage: "The keyword 'var' can't be used as a type name." - analyzerCode: ParserErrorCode.VAR_AS_TYPE_NAME - script: - - "class A { Map<String, var> m; }" - exampleAllowOtherCodes: true - -MissingExpressionInThrow: - parameters: none - index: 32 - problemMessage: "Missing expression after 'throw'." - correctionMessage: "Add an expression after 'throw' or use 'rethrow' to throw a caught exception" - analyzerCode: ParserErrorCode.MISSING_EXPRESSION_IN_THROW - statement: - - "throw;" - -MissingConstFinalVarOrType: - parameters: none - index: 33 - problemMessage: "Variables must be declared using the keywords 'const', 'final', 'var' or a type name." - correctionMessage: "Try adding the name of the type of the variable or the keyword 'var'." - analyzerCode: ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE - script: - - "class C { static f; }" - -FunctionTypedParameterVar: - parameters: none - index: 119 - problemMessage: "Function-typed parameters can't specify 'const', 'final' or 'var' in place of a return type." - correctionMessage: "Try replacing the keyword with a return type." - analyzerCode: ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR - script: - - "void f(const x()) {}" - - "void f(final x()) {}" - - "void f(var x()) {}" - exampleAllowOtherCodes: true - -AbstractClassMember: - parameters: none - index: 51 - problemMessage: "Members of classes can't be declared to be 'abstract'." - correctionMessage: "Try removing the 'abstract' keyword. You can add the 'abstract' keyword before the class declaration." - analyzerCode: ParserErrorCode.ABSTRACT_CLASS_MEMBER - 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);} - -AbstractExternalField: - parameters: none - index: 110 - problemMessage: "Fields can't be declared both 'abstract' and 'external'." - analyzerCode: ParserErrorCode.ABSTRACT_EXTERNAL_FIELD - correctionMessage: "Try removing the 'abstract' or 'external' keyword." - script: - - "abstract class C {abstract external var f;}" - - "abstract class C {external abstract var f;}" - -AbstractStaticField: - parameters: none - index: 107 - problemMessage: "Static fields can't be declared 'abstract'." - analyzerCode: ParserErrorCode.ABSTRACT_STATIC_FIELD - correctionMessage: "Try removing the 'abstract' or 'static' keyword." - script: - - "abstract class C {abstract static var f;}" - AbstractExtensionField: parameters: none problemMessage: "Extension fields can't be declared 'abstract'." @@ -1606,167 +1045,6 @@ - "abstract class C {abstract var f; C(this.f);}" - "abstract class C {abstract var f; C() : this.f = 0;}" -AbstractLateField: - parameters: none - index: 108 - problemMessage: "Abstract fields cannot be late." - analyzerCode: ParserErrorCode.ABSTRACT_LATE_FIELD - correctionMessage: "Try removing the 'abstract' or 'late' keyword." - script: - - "abstract class C {abstract late var f;}" - -AbstractFinalBaseClass: - parameters: none - problemMessage: "An 'abstract' class can't be declared as both 'final' and 'base'." - correctionMessage: "Try removing either the 'final' or 'base' keyword." - analyzerCode: ParserErrorCode.ABSTRACT_FINAL_BASE_CLASS - index: 176 - script: - - "abstract final base class C {}" - -AbstractFinalInterfaceClass: - parameters: none - problemMessage: "An 'abstract' class can't be declared as both 'final' and 'interface'." - correctionMessage: "Try removing either the 'final' or 'interface' keyword." - analyzerCode: ParserErrorCode.ABSTRACT_FINAL_INTERFACE_CLASS - index: 50 - script: - - "abstract final interface class C {}" - -AbstractSealedClass: - parameters: none - problemMessage: "A 'sealed' class can't be marked 'abstract' because it's already implicitly abstract." - correctionMessage: "Try removing the 'abstract' keyword." - analyzerCode: ParserErrorCode.ABSTRACT_SEALED_CLASS - index: 132 - hasPublishedDocs: true - documentation: |- - #### Description - - The analyzer produces this diagnostic when a class is declared using both - the modifier `abstract` and the modifier `sealed`. Sealed classes are - implicitly abstract, so explicitly using both modifiers is not allowed. - - #### Example - - The following code produces this diagnostic because the class `C` is - declared using both `abstract` and `sealed`: - - ```dart - abstract [!sealed!] class C {} - ``` - - #### Common fixes - - If the class should be abstract but not sealed, then remove the `sealed` - modifier: - - ```dart - abstract class C {} - ``` - - If the class should be both abstract and sealed, then remove the - `abstract` modifier: - - ```dart - sealed class C {} - ``` - script: - - "sealed abstract class C {}" - - "abstract sealed class C {}" - -ClassInClass: - parameters: none - index: 53 - problemMessage: "Classes can't be declared inside other classes." - correctionMessage: "Try moving the class to the top-level." - analyzerCode: ParserErrorCode.CLASS_IN_CLASS - script: - - "class C { class B {} }" - -EnumInClass: - parameters: none - index: 74 - problemMessage: "Enums can't be declared inside classes." - correctionMessage: "Try moving the enum to the top-level." - analyzerCode: ParserErrorCode.ENUM_IN_CLASS - script: - - "class Foo { enum Bar { Bar1, Bar2, Bar3 } }" - -TypedefInClass: - parameters: none - index: 7 - problemMessage: "Typedefs can't be declared inside classes." - correctionMessage: "Try moving the typedef to the top-level." - analyzerCode: ParserErrorCode.TYPEDEF_IN_CLASS - script: - - "abstract class C { typedef int F(int x); }" - -CovariantMember: - parameters: none - index: 67 - problemMessage: "Getters, setters and methods can't be declared to be 'covariant'." - correctionMessage: "Try removing the 'covariant' keyword." - analyzerCode: ParserErrorCode.COVARIANT_MEMBER - script: - - "class A { covariant get x => 0; }" - - "class A { covariant int m() => 0; }" - -VarReturnType: - parameters: none - index: 12 - problemMessage: "The return type can't be 'var'." - correctionMessage: "Try removing the keyword 'var', or replacing it with the name of the return type." - analyzerCode: ParserErrorCode.VAR_RETURN_TYPE - script: - - "class C { var m() {} }" - - "class C { var C() {} }" - -ConstClass: - parameters: none - index: 60 - problemMessage: "Classes can't be declared to be 'const'." - correctionMessage: "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: ParserErrorCode.CONST_CLASS - script: "const class C {}" - -ConstAndFinal: - parameters: none - index: 58 - problemMessage: "Members can't be declared to be both 'const' and 'final'." - correctionMessage: "Try removing either the 'const' or 'final' keyword." - analyzerCode: ParserErrorCode.CONST_AND_FINAL - declaration: - - "class C { static const final int x = 5; }" - - "class C { static final const int x = 5; }" - - "const final int x = 5;" - - "final const int x = 5;" - -ConflictingModifiers: - parameters: - String string: undocumented - String string2: undocumented - index: 59 - problemMessage: "Members can't be declared to be both '#string' and '#string2'." - correctionMessage: "Try removing one of the keywords." - analyzerCode: ParserErrorCode.CONFLICTING_MODIFIERS - script: - - "class C { const var x; }" - - "class C { var const x; }" - exampleAllowOtherCodes: true - -ConstFactory: - parameters: none - index: 62 - problemMessage: "Only redirecting factory constructors can be declared to be 'const'." - correctionMessage: "Try removing the 'const' keyword, or replacing the body with '=' followed by a valid target." - analyzerCode: ParserErrorCode.CONST_FACTORY - script: | - class C { - const factory C() => const C.internal(); - const C.internal(); - } - ConstFactoryRedirectionToNonConst: parameters: none problemMessage: "Constant factory constructor can't delegate to a non-constant constructor." @@ -1806,36 +1084,6 @@ const Foo(); } -ModifierOutOfOrder: - parameters: - String string: undocumented - String string2: undocumented - index: 56 - problemMessage: "The modifier '#string' should be before the modifier '#string2'." - correctionMessage: "Try re-ordering the modifiers." - analyzerCode: ParserErrorCode.MODIFIER_OUT_OF_ORDER - script: - - "class C { factory const C() = prefix.B.foo; }" - - "class C { factory external C(); }" - - "class C { const external C(); }" - - "class C { static external f(); }" - - "class C { final static int f = 5; }" - - "class C { var static f; }" - - "var external foo; main(){}" - exampleAllowOtherCodes: true - -TypeBeforeFactory: - parameters: none - index: 57 - problemMessage: "Factory constructors cannot have a return type." - correctionMessage: "Try removing the type appearing before 'factory'." - analyzerCode: ParserErrorCode.TYPE_BEFORE_FACTORY - script: | - class C { - T factory C() { return new C.constructor(); } - C.constructor(); - } - ConstConstructorWithBody: parameters: none problemMessage: "A const constructor can't have a body." @@ -1844,65 +1092,6 @@ script: - "class C { const C() {} }" -ConstMethod: - parameters: none - index: 63 - problemMessage: "Getters, setters and methods can't be declared to be 'const'." - correctionMessage: "Try removing the 'const' keyword." - analyzerCode: ParserErrorCode.CONST_METHOD - script: - - "class C { const m() {} }" - -CovariantAndStatic: - parameters: none - index: 66 - problemMessage: "Members can't be declared to be both 'covariant' and 'static'." - correctionMessage: "Try removing either the 'covariant' or 'static' keyword." - analyzerCode: ParserErrorCode.COVARIANT_AND_STATIC - script: - - "class A {} class C { covariant static A? f; }" - - "class A {} class C { static covariant A? f; }" - -DuplicatedModifier: - parameters: - Token lexeme: undocumented - index: 70 - problemMessage: "The modifier '#lexeme' was already specified." - correctionMessage: "Try removing all but one occurrence of the modifier." - analyzerCode: ParserErrorCode.DUPLICATED_MODIFIER - comment: |- - Parameters: - 0: the modifier that was duplicated - exampleAllowOtherCodes: true - script: - - "class C { const const m; }" - - "class C { external external f(); }" - - "class C { final final m = 5; }" - - "class C { static static var m; }" - - "class C { var var m; }" - -ExternalConstructorWithFieldInitializers: - parameters: none - index: 87 - problemMessage: "An external constructor can't initialize fields." - correctionMessage: "Try removing the field initializers, or removing the keyword 'external'." - analyzerCode: ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_FIELD_INITIALIZERS - script: | - class Foo { - var x = -1; - external Foo.x(this.x); - } - -ExternalFactoryWithBody: - parameters: none - index: 86 - problemMessage: "External factories can't have a body." - correctionMessage: "Try removing the body of the factory, or removing the keyword 'external'." - analyzerCode: ParserErrorCode.EXTERNAL_FACTORY_WITH_BODY - script: - - "class C { external factory C() {} }" - exampleAllowOtherCodes: true - ExternalFieldInitializer: parameters: none problemMessage: "External fields cannot have initializers." @@ -1919,16 +1108,6 @@ - "abstract class C {external var f; C(this.f);}" - "abstract class C {external var f; C() : this.f = 0;}" -ExternalLateField: - parameters: none - index: 109 - problemMessage: "External fields cannot be late." - analyzerCode: ParserErrorCode.EXTERNAL_LATE_FIELD - correctionMessage: "Try removing the 'external' or 'late' keyword." - script: - - "external late var f;" - - "abstract class C {external late var f;}" - InitializerForStaticField: parameters: Name name: undocumented @@ -1979,164 +1158,6 @@ script: - "class C { int x; C.bad() : super(), x = 5; }" -ExtraneousModifier: - parameters: - Token lexeme: undocumented - index: 77 - problemMessage: "Can't have modifier '#lexeme' here." - correctionMessage: "Try removing '#lexeme'." - analyzerCode: ParserErrorCode.EXTRANEOUS_MODIFIER - script: - - "var abstract foo; main(){}" - - "var static foo; main(){}" - - "abstract var foo; main(){}" - - "static var foo; main(){}" - - "abstract foo; main(){}" - - "static foo; main(){}" - - "abstract enum foo {bar}" - - "abstract void foo() {}" - - "static void foo() {}" - - "abstract typedef foo();" - - "static typedef foo();" - exampleAllowOtherCodes: true - -ExtraneousModifierInExtension: - parameters: - Token lexeme: undocumented - index: 98 - problemMessage: "Can't have modifier '#lexeme' in an extension." - correctionMessage: "Try removing '#lexeme'." - analyzerCode: ParserErrorCode.INVALID_USE_OF_COVARIANT_IN_EXTENSION - hasPublishedDocs: true - comment: No parameters. - documentation: |- - #### Description - - The analyzer produces this diagnostic when a member declared inside an - extension uses the keyword `covariant` in the declaration of a parameter. - Extensions aren't classes and don't have subclasses, so the keyword serves - no purpose. - - #### Example - - The following code produces this diagnostic because `i` is marked as being - covariant: - - ```dart - extension E on String { - void a([!covariant!] int i) {} - } - ``` - - #### Common fixes - - Remove the `covariant` keyword: - - ```dart - extension E on String { - void a(int i) {} - } - ``` - script: - - "extension on String { foo(covariant String child) {} }" - -ExtraneousModifierInExtensionType: - parameters: - Token lexeme: undocumented - index: 174 - problemMessage: "Can't have modifier '#lexeme' in an extension type." - correctionMessage: "Try removing '#lexeme'." - analyzerCode: ParserErrorCode.EXTRANEOUS_MODIFIER_IN_EXTENSION_TYPE - script: - - "extension type ET(String i) { foo(covariant String child) {} }" - -ExtraneousModifierInPrimaryConstructor: - parameters: - Token lexeme: undocumented - index: 175 - problemMessage: "Can't have modifier '#lexeme' in a primary constructor." - correctionMessage: "Try removing '#lexeme'." - analyzerCode: ParserErrorCode.EXTRANEOUS_MODIFIER_IN_PRIMARY_CONSTRUCTOR - script: - - "extension type ET(covariant String i) { }" - -FinalAndCovariant: - parameters: none - index: 80 - problemMessage: "Members can't be declared to be both 'final' and 'covariant'." - correctionMessage: "Try removing either the 'final' or 'covariant' keyword." - analyzerCode: ParserErrorCode.FINAL_AND_COVARIANT - script: - - "class C { covariant final f = 5; }" - - "class C { final covariant f = 5; }" - exampleAllowOtherCodes: true - -FinalAndCovariantLateWithInitializer: - parameters: none - index: 101 - problemMessage: "Members marked 'late' with an initializer can't be declared to be both 'final' and 'covariant'." - correctionMessage: "Try removing either the 'final' or 'covariant' keyword, or removing the initializer." - analyzerCode: ParserErrorCode.FINAL_AND_COVARIANT_LATE_WITH_INITIALIZER - # Weak and strong doesn't matter in this instance. - script: - - "class C { covariant late final f = 5; }" - -FinalAndVar: - parameters: none - index: 81 - problemMessage: "Members can't be declared to be both 'final' and 'var'." - correctionMessage: "Try removing the keyword 'var'." - analyzerCode: ParserErrorCode.FINAL_AND_VAR - script: - - "class C { final var x = 5; }" - - "class C { var final x = 5; }" - -StaticConstructor: - parameters: none - index: 4 - problemMessage: "Constructors can't be static." - correctionMessage: "Try removing the keyword 'static'." - analyzerCode: ParserErrorCode.STATIC_CONSTRUCTOR - script: - - "class C { static C() {} }" - - "class C { static C.m() {} }" - -GetterConstructor: - parameters: none - index: 103 - problemMessage: "Constructors can't be a getter." - correctionMessage: "Try removing 'get'." - analyzerCode: ParserErrorCode.GETTER_CONSTRUCTOR - script: - - "class C { get C.m() {} }" - -SetterConstructor: - parameters: none - index: 104 - problemMessage: "Constructors can't be a setter." - correctionMessage: "Try removing 'set'." - analyzerCode: ParserErrorCode.SETTER_CONSTRUCTOR - script: - - "class C { set C.m(x) {} }" - -StaticOperator: - parameters: none - index: 17 - problemMessage: "Operators can't be static." - correctionMessage: "Try removing the keyword 'static'." - analyzerCode: ParserErrorCode.STATIC_OPERATOR - script: - - "class C { static operator +(int x) => x + 1; }" - -BreakOutsideOfLoop: - parameters: none - index: 52 - problemMessage: "A break statement can't be used outside of a loop or switch statement." - correctionMessage: "Try removing the break statement." - analyzerCode: ParserErrorCode.BREAK_OUTSIDE_OF_LOOP - script: - - "main() { break; }" - InvalidBreakTarget: parameters: Name name: undocumented @@ -2184,16 +1205,6 @@ statement: - "L: { for (var i in [ ]) { continue L; } }" -ContinueOutsideOfLoop: - parameters: none - index: 2 - problemMessage: "A continue statement can't be used outside of a loop or switch statement." - correctionMessage: "Try removing the continue statement." - analyzerCode: ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP - script: - - "main() { continue; }" - exampleAllowOtherCodes: true - InvalidContinueTarget: parameters: Name name: undocumented @@ -2235,28 +1246,6 @@ } exampleAllowOtherCodes: true -ContinueWithoutLabelInCase: - parameters: none - index: 64 - problemMessage: "A continue statement in a switch statement must have a label as a target." - correctionMessage: "Try adding a label associated with one of the case clauses to the continue statement." - analyzerCode: ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE - script: - - "main(List<String> x) { switch (x) {case 1: continue;} }" - -DuplicateLabelInSwitchStatement: - parameters: - Name name: undocumented - index: 72 - problemMessage: "The label '#name' was already used in this switch statement." - correctionMessage: "Try choosing a different name for this label." - analyzerCode: ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT - comment: |- - Parameters: - 0: the label that was duplicated - statement: - - "switch (0) {l1: case 0: break; l1: case 1: break;}" - LabelNotFound: parameters: Name name: undocumented @@ -2266,24 +1255,6 @@ statement: - "switch (0) {case 0: continue L;}" -InitializedVariableInForEach: - parameters: none - index: 82 - problemMessage: "The loop variable in a for-each loop can't be initialized." - correctionMessage: "Try removing the initializer, or using a different kind of loop." - analyzerCode: ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH - statement: - - "for (int a = 0 in <int>[10]) {}" - -InvalidAwaitFor: - parameters: none - index: 9 - problemMessage: "The keyword 'await' isn't allowed for a normal 'for' statement." - correctionMessage: "Try removing the keyword, or use a for-each statement." - analyzerCode: ParserErrorCode.INVALID_AWAIT_IN_FOR - script: - - "f() async {await for (int i = 0; i < 5; i++) {}}" - InvalidSyncModifier: parameters: none problemMessage: "Invalid modifier 'sync'." @@ -2300,43 +1271,6 @@ - "class Foo extends void {}" exampleAllowOtherCodes: true -VoidWithTypeArguments: - parameters: none - problemMessage: "Type 'void' can't have type arguments." - correctionMessage: "Try removing the type arguments." - index: 100 - analyzerCode: ParserErrorCode.VOID_WITH_TYPE_ARGUMENTS - script: - - "void<int> f() {}" - -# TODO(danrubel): Review where this error is generated and consider generating -# FieldInitializedOutsideDeclaringClass instead of this in some situations. -InvalidInitializer: - parameters: none - index: 90 - problemMessage: "Not a valid initializer." - correctionMessage: "To initialize a field, use the syntax 'name = value'." - analyzerCode: ParserErrorCode.INVALID_INITIALIZER - script: | - class A { - int a = 0; - } - - class B extends A { - B() : super.a = 42; - } - exampleAllowOtherCodes: true - -FieldInitializedOutsideDeclaringClass: - parameters: none - index: 88 - problemMessage: "A field can only be initialized in its declaring class" - correctionMessage: "Try passing a value into the superclass constructor, or moving the initialization into the constructor body." - analyzerCode: ParserErrorCode.FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS - script: - - "class A { int a; } class C extends A { C() : super.a = 42; }" - exampleAllowOtherCodes: true - FinalFieldNotInitialized: parameters: Name name: undocumented @@ -2399,13 +1333,6 @@ foo(2); } -StackOverflow: - parameters: none - index: 19 - problemMessage: "The file has too many nested expressions or statements." - correctionMessage: "Try simplifying the code." - analyzerCode: ParserErrorCode.STACK_OVERFLOW - InvalidCodePoint: parameters: none problemMessage: "The escape sequence starting with '\\u' isn't a valid code point." @@ -2413,54 +1340,6 @@ expression: - "'\\u{110000}'" -InvalidHexEscape: - parameters: none - index: 40 - problemMessage: "An escape sequence starting with '\\x' must be followed by 2 hexadecimal digits." - analyzerCode: ParserErrorCode.INVALID_HEX_ESCAPE - expression: - - "'\\x0'" - - "'\\x0y'" - -InvalidUnicodeEscapeUStarted: - parameters: none - index: 38 - problemMessage: "An escape sequence starting with '\\u' must be followed by 4 hexadecimal digits or from 1 to 6 digits between '{' and '}'." - analyzerCode: ParserErrorCode.INVALID_UNICODE_ESCAPE_U_STARTED - expression: - - "'\\u'" - -InvalidUnicodeEscapeUNoBracket: - parameters: none - index: 124 - problemMessage: "An escape sequence starting with '\\u' must be followed by 4 hexadecimal digits." - analyzerCode: ParserErrorCode.INVALID_UNICODE_ESCAPE_U_NO_BRACKET - expression: - - "'\\u0F'" - -InvalidUnicodeEscapeUBracket: - parameters: none - index: 125 - problemMessage: "An escape sequence starting with '\\u{' must be followed by 1 to 6 hexadecimal digits followed by a '}'." - analyzerCode: ParserErrorCode.INVALID_UNICODE_ESCAPE_U_BRACKET - expression: - - "'\\u{'" - - "'\\u{03'" - - "'\\u{0Z}'" - - "'\\u{0000003}'" - -InvalidEscapeStarted: - parameters: none - index: 126 - problemMessage: "The string '\\' can't stand alone." - correctionMessage: "Try adding another backslash (\\) to escape the '\\'." - analyzerCode: ParserErrorCode.INVALID_UNICODE_ESCAPE_STARTED - exampleAllowOtherCodes: true - expression: - - | - print('Hello, World!\ - '); - UnexpectedDollarInString: parameters: none problemMessage: "A '$' has special meaning inside a string, and must be followed by an identifier or an expression in curly braces ({})." @@ -2497,68 +1376,6 @@ - "import 'b.dart' d as b;" exampleAllowOtherCodes: true -UnexpectedTokens: - parameters: none - problemMessage: "Unexpected tokens." - analyzerCode: ParserErrorCode.UNEXPECTED_TOKENS - index: 123 - script: "enum E w Foo { v; }" - -LiteralWithClassAndNew: - parameters: - String string: undocumented - Token lexeme: undocumented - problemMessage: "A #string literal can't be prefixed by 'new #lexeme'." - correctionMessage: "Try removing 'new' and '#lexeme'" - analyzerCode: ParserErrorCode.LITERAL_WITH_CLASS_AND_NEW - index: 115 - script: - - "var x = new Map{};" - - "var x = new Set{};" - - "var x = new List[];" - - "var x = new Map{1: 2};" - - "var x = new Set{1};" - - "var x = new List[1];" - -LiteralWithClass: - parameters: - String string: undocumented - Token lexeme: undocumented - problemMessage: "A #string literal can't be prefixed by '#lexeme'." - correctionMessage: "Try removing '#lexeme'" - analyzerCode: ParserErrorCode.LITERAL_WITH_CLASS - index: 116 - script: - - "var x = Map{};" - - "var x = Set{};" - - "var x = List<String>[];" - - "var x = Map{1: 2};" - - "var x = Set{1};" - - "var x = List<int>[1];" - - "var x = const Map{};" - - "var x = const Set{};" - - "var x = const List[];" - - "var x = const Map{1: 2};" - - "var x = const Set{1};" - - "var x = const List[1];" - -LiteralWithNew: - parameters: none - problemMessage: "A literal can't be prefixed by 'new'." - correctionMessage: "Try removing 'new'" - analyzerCode: ParserErrorCode.LITERAL_WITH_NEW - index: 117 - script: - - "var x = new <String, String>{};" - - "var x = new <String>{};" - - "var x = new {};" - - "var x = new [];" - - "var x = new <String, String>{'a': 'b'};" - - "var x = new <String>{'a'};" - - "var x = new {'a': 'b'};" - - "var x = new {'a'};" - - "var x = new ['a'];" - UnmatchedToken: parameters: String string: undocumented @@ -2763,24 +1580,6 @@ return []; } -OnlyTry: - parameters: none - index: 20 - problemMessage: "A try block must be followed by an 'on', 'catch', or 'finally' clause." - correctionMessage: "Try adding either a catch or finally clause, or remove the try statement." - analyzerCode: ParserErrorCode.MISSING_CATCH_OR_FINALLY - statement: "try {}" - -TypeAfterVar: - parameters: none - index: 89 - problemMessage: "Variables can't be declared using both 'var' and a type name." - correctionMessage: "Try removing 'var.'" - analyzerCode: ParserErrorCode.VAR_AND_TYPE - script: - - "var String foo; main(){}" - exampleAllowOtherCodes: true - PositionalAfterNamedArgument: parameters: none problemMessage: "Place positional arguments before named arguments." @@ -2837,55 +1636,6 @@ - "var set foo; main(){}" exampleAllowOtherCodes: true -CatchSyntax: - parameters: none - index: 84 - problemMessage: "'catch' must be followed by '(identifier)' or '(identifier, identifier)'." - correctionMessage: "No types are needed, the first is given by 'on', the second is always 'StackTrace'." - analyzerCode: ParserErrorCode.CATCH_SYNTAX - statement: - - "try {} catch {}" - - "try {} catch () {}" - - "try {} catch (e,) {}" - -CatchSyntaxExtraParameters: - parameters: none - index: 83 - problemMessage: "'catch' must be followed by '(identifier)' or '(identifier, identifier)'." - correctionMessage: "No types are needed, the first is given by 'on', the second is always 'StackTrace'." - analyzerCode: ParserErrorCode.CATCH_SYNTAX_EXTRA_PARAMETERS - statement: - - "try {} catch (e, s, x) {}" - -SuperNullAware: - parameters: none - index: 18 - problemMessage: "The operator '?.' cannot be used with 'super' because 'super' cannot be null." - correctionMessage: "Try replacing '?.' with '.'" - analyzerCode: ParserErrorCode.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER - script: | - class Super { - Super.named(); - } - class Class extends Super { - Class() : super?.named(); - } - exampleAllowOtherCodes: true - -NullAwareCascadeOutOfOrder: - parameters: none - index: 96 - problemMessage: "The '?..' cascade operator must be first in the cascade sequence." - correctionMessage: "Try moving the '?..' operator to be the first cascade operator in the sequence." - analyzerCode: ParserErrorCode.NULL_AWARE_CASCADE_OUT_OF_ORDER - script: | - void foo(int? x) { - x - ..hashCode - ?..isEven; - } - exampleAllowOtherCodes: true - ConstFieldWithoutInitializer: parameters: Name name: undocumented @@ -2906,45 +1656,6 @@ - "var final foo; main(){}" exampleAllowOtherCodes: true -MetadataTypeArguments: - parameters: none - index: 91 - problemMessage: "An annotation can't use type arguments." - analyzerCode: ParserErrorCode.ANNOTATION_WITH_TYPE_ARGUMENTS - script: | - // @dart=2.12 - class C<T> { - const C(); - } - @C<int>() // Error - void foo() {} - -MetadataTypeArgumentsUninstantiated: - parameters: none - index: 114 - problemMessage: "An annotation with type arguments must be followed by an argument list." - analyzerCode: ParserErrorCode.ANNOTATION_WITH_TYPE_ARGUMENTS_UNINSTANTIATED - script: - - "@deprecated<int> class C {}" - -MetadataSpaceBeforeParenthesis: - parameters: none - index: 134 - problemMessage: "Annotations can't have spaces or comments before the parenthesis." - correctionMessage: Remove any spaces or comments before the parenthesis. - analyzerCode: ParserErrorCode.ANNOTATION_SPACE_BEFORE_PARENTHESIS - script: - - >- - class Foo<T> { - const Foo(); - } - @Foo<int> () var bar; - - >- - class Foo { - const Foo(); - } - @Foo () class Bar {} - ConstructorNotFound: parameters: Name name: undocumented @@ -2958,67 +1669,6 @@ new Foo.baz(); } -ConstructorWithReturnType: - parameters: none - index: 55 - problemMessage: "Constructors can't have a return type." - correctionMessage: "Try removing the return type." - analyzerCode: ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE - script: - - "class C { int C() {} }" - - "class C { void C.m() {} }" - -ConstructorWithTypeParameters: - parameters: none - index: 99 - problemMessage: "Constructors can't have type parameters." - analyzerCode: ParserErrorCode.TYPE_PARAMETER_ON_CONSTRUCTOR - correctionMessage: "Try removing the type parameters." - script: - - >- - class C { C<T>() {} } - - >- - class C { C.foo<T>() {} } - - >- - class C { - factory C<T>() => new C.internal(); - C.internal(); - } - - >- - class C { - factory C.foo<T>() => new C.internal(); - C.internal(); - } - -ConstructorWithTypeArguments: - parameters: none - problemMessage: "A constructor invocation can't have type arguments after the constructor name." - correctionMessage: "Try removing the type arguments or placing them after the class name." - analyzerCode: ParserErrorCode.CONSTRUCTOR_WITH_TYPE_ARGUMENTS - index: 118 - script: - - "class C<X> { C.foo(); } bar() { new C.foo<int>(); }" - - "class C<X> { C.foo(); } bar() { C.foo<int>(); }" - -ConstructorWithWrongName: - parameters: none - problemMessage: "The name of a constructor must match the name of the enclosing class." - analyzerCode: ParserErrorCode.INVALID_CONSTRUCTOR_NAME - index: 102 - script: - - >- - class A { B.foo() {} } - - >- - class A { - factory B() => new A.internal(); - A.internal(); - } - - >- - class A { - factory B.foo() => new A.internal(); - A.internal(); - } - ConstructorWithWrongNameContext: parameters: Name name: undocumented @@ -3033,17 +1683,6 @@ script: - "class C { C.foo() : this.bar(); C.bar() : this.foo(); }" -FieldInitializerOutsideConstructor: - parameters: none - index: 79 - problemMessage: "Field formal parameters can only be used in a constructor." - correctionMessage: "Try removing 'this.'." - analyzerCode: ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR - hasPublishedDocs: true - script: - - "class C { void m(this.x); }" - exampleAllowOtherCodes: true - SuperParameterInitializerOutsideConstructor: parameters: none problemMessage: "Super-initializer formal parameters can only be used in generative constructors." @@ -3464,13 +2103,6 @@ script: | var x = void f<T>(T t) {}; -NativeClauseShouldBeAnnotation: - parameters: none - index: 23 - problemMessage: "Native clause in this form is deprecated." - correctionMessage: "Try removing this native clause and adding @native() or @native('native-name') before the declaration." - analyzerCode: ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION - InternalProblemUnhandled: parameters: String string: undocumented @@ -3627,39 +2259,6 @@ problemMessage: "Fatal '#name' at:\n#string" severity: IGNORED -MissingPrefixInDeferredImport: - parameters: none - index: 30 - problemMessage: "Deferred imports should have a prefix." - correctionMessage: "Try adding a prefix to the import by adding an 'as' clause." - analyzerCode: ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT - script: - main.dart: | - import 'lib.dart' deferred; - lib.dart: "" - -DeferredAfterPrefix: - parameters: none - index: 68 - problemMessage: "The deferred keyword should come immediately before the prefix ('as' clause)." - correctionMessage: "Try moving the deferred keyword before the prefix." - analyzerCode: ParserErrorCode.DEFERRED_AFTER_PREFIX - script: - main.dart: | - import "lib.dart" as foo deferred; - lib.dart: "" - -DuplicateDeferred: - parameters: none - index: 71 - problemMessage: "An import directive can only have one 'deferred' keyword." - correctionMessage: "Try removing all but one 'deferred' keyword." - analyzerCode: ParserErrorCode.DUPLICATE_DEFERRED - script: - main.dart: | - import "lib.dart" deferred as foo deferred; - lib.dart: "" - DeferredTypeAnnotation: parameters: Type type: undocumented @@ -3676,28 +2275,6 @@ lib.dart: | class C {} -DuplicatePrefix: - parameters: none - index: 73 - problemMessage: "An import directive can only have one prefix ('as' clause)." - correctionMessage: "Try removing all but one prefix." - analyzerCode: ParserErrorCode.DUPLICATE_PREFIX - script: - main.dart: | - import "lib.dart" as foo as bar; - lib.dart: "" - -PrefixAfterCombinator: - parameters: none - index: 6 - problemMessage: "The prefix ('as' clause) should come before any show/hide combinators." - correctionMessage: "Try moving the prefix before the combinators." - analyzerCode: ParserErrorCode.PREFIX_AFTER_COMBINATOR - script: - main.dart: | - import "lib.dart" show Foo hide Foo as Foo; - lib.dart: "" - DuplicatedExport: parameters: Name name: undocumented @@ -3818,56 +2395,12 @@ // @dart=2.19 class B with Error {} -MixinDeclaresConstructor: - # a mixin declaration contains a constructor declaration - parameters: none - index: 95 - problemMessage: "Mixins can't declare constructors." - analyzerCode: ParserErrorCode.MIXIN_DECLARES_CONSTRUCTOR - script: | - mixin M { - const M(); - } - IllegalMixinDueToConstructorsCause: parameters: Name name: undocumented problemMessage: "This constructor prevents using '#name' as a mixin." severity: CONTEXT -ExtensionDeclaresAbstractMember: - parameters: none - index: 94 - problemMessage: "Extensions can't declare abstract members." - correctionMessage: "Try providing an implementation for the member." - script: | - extension E on int { - void method(); - } - analyzerCode: ParserErrorCode.EXTENSION_DECLARES_ABSTRACT_MEMBER - comment: No parameters. - documentation: |- - #### Description - - The analyzer produces this diagnostic when an abstract declaration is - declared in an extension. Extensions can declare only concrete members. - - #### Example - - The following code produces this diagnostic because the method `a` doesn't - have a body: - - ```dart - extension E on String { - int [!a!](); - } - ``` - - #### Common fixes - - Either provide an implementation for the member or remove it. - hasPublishedDocs: true - ExtensionTypeDeclaresAbstractMember: parameters: none problemMessage: "Extension types can't declare abstract members." @@ -3878,41 +2411,6 @@ void method(); } -ExtensionDeclaresConstructor: - parameters: none - index: 92 - problemMessage: "Extensions can't declare constructors." - correctionMessage: "Try removing the constructor declaration." - script: | - extension E on int { - E(); - } - analyzerCode: ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR - comment: No parameters. - documentation: |- - #### Description - - The analyzer produces this diagnostic when a constructor declaration is - found in an extension. It isn't valid to define a constructor because - extensions aren't classes, and it isn't possible to create an instance of - an extension. - - #### Example - - The following code produces this diagnostic because there is a constructor - declaration in `E`: - - ```dart - extension E on String { - [!E!]() : super(); - } - ``` - - #### Common fixes - - Remove the constructor or replace it with a static method. - hasPublishedDocs: true - ExtensionDeclaresInstanceField: parameters: none problemMessage: "Extensions can't declare instance fields" @@ -3923,16 +2421,6 @@ int? field; } -ExtensionAugmentationHasOnClause: - parameters: none - index: 93 - problemMessage: "Extension augmentations can't have 'on' clauses." - correctionMessage: "Try removing the 'on' clause." - analyzerCode: ParserErrorCode.EXTENSION_AUGMENTATION_HAS_ON_CLAUSE - script: | - augment extension E on int {} - comment: No parameters. - ExtensionTypeDeclaresInstanceField: parameters: none problemMessage: "Extension types can't declare instance fields" @@ -4541,14 +3029,6 @@ script: | class C<C> {} -AnnotationOnTypeArgument: - parameters: none - problemMessage: "Type arguments can't have annotations because they aren't declarations." - analyzerCode: ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT - index: 111 - script: - - "class A<E> {} class C { m() => new A<@Object() C>(); }" - AnnotationOnFunctionTypeTypeParameter: parameters: none problemMessage: "A type variable on a function type can't have annotations." @@ -4572,53 +3052,6 @@ script: - "enum E {}" -ExternalClass: - parameters: none - index: 3 - problemMessage: "Classes can't be declared to be 'external'." - correctionMessage: "Try removing the keyword 'external'." - analyzerCode: ParserErrorCode.EXTERNAL_CLASS - script: - - "external class C {}" - -ExternalEnum: - parameters: none - index: 5 - problemMessage: "Enums can't be declared to be 'external'." - correctionMessage: "Try removing the keyword 'external'." - analyzerCode: ParserErrorCode.EXTERNAL_ENUM - script: - - "external enum E {ONE}" - -ExternalMethodWithBody: - # TODO(danrubel): remove reference to `native` once support has been removed - parameters: none - index: 49 - problemMessage: "An external or native method can't have a body." - analyzerCode: ParserErrorCode.EXTERNAL_METHOD_WITH_BODY - script: - - "class C {external foo() {}}" - - "class C {foo() native {}}" - - "class C {foo() native 'bar' {}}" - -ExternalConstructorWithInitializer: - parameters: none - index: 106 - problemMessage: "An external constructor can't have any initializers." - analyzerCode: ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_INITIALIZER - script: - - "class C { int? x; external C() : x = 1; }" - - "class C { int? x; external C.foo() : x = 1; }" - -ExternalTypedef: - parameters: none - index: 76 - problemMessage: "Typedefs can't be declared to be 'external'." - correctionMessage: "Try removing the keyword 'external'." - analyzerCode: ParserErrorCode.EXTERNAL_TYPEDEF - script: - - "external typedef F();" - OperatorWithOptionalFormals: parameters: none problemMessage: "An operator can't have optional parameters." @@ -4627,18 +3060,6 @@ operator ==([Object a = 0]) => true; } -OperatorWithTypeParameters: - parameters: none - index: 120 - problemMessage: "Types parameters aren't allowed when defining an operator." - correctionMessage: "Try removing the type parameters." - analyzerCode: ParserErrorCode.TYPE_PARAMETER_ON_OPERATOR - comment: |- - 7.1.1 Operators: Type parameters are not syntactically supported on an - operator. - script: - - "class C { operator []<T>(T t) => null; }" - PlatformPrivateLibraryAccess: parameters: none problemMessage: "Can't access platform private library." @@ -4693,54 +3114,6 @@ problemMessage: "The issue arises via this type alias." severity: CONTEXT -LibraryDirectiveNotFirst: - parameters: none - index: 37 - problemMessage: "The library directive must appear before all other directives." - correctionMessage: "Try moving the library directive before any other directives." - analyzerCode: ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST - script: - - "class Foo{} library l;" - - "import 'x.dart'; library l;" - - "part 'a.dart'; library l;" - exampleAllowOtherCodes: true - -ImportAfterPart: - parameters: none - index: 10 - problemMessage: "Import directives must precede part directives." - correctionMessage: "Try moving the import directives before the part directives." - analyzerCode: ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE - script: - - "part 'foo.dart'; import 'bar.dart';" - exampleAllowOtherCodes: true - -ExportAfterPart: - parameters: none - index: 75 - problemMessage: "Export directives must precede part directives." - correctionMessage: "Try moving the export directives before the part directives." - analyzerCode: ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE - exampleAllowOtherCodes: true - script: - - "part 'foo.dart'; export 'bar.dart';" - -DirectiveAfterDeclaration: - parameters: none - index: 69 - problemMessage: "Directives must appear before any declarations." - correctionMessage: "Try moving the directive before any declarations." - analyzerCode: ParserErrorCode.DIRECTIVE_AFTER_DECLARATION - script: - - main.dart: | - class foo { } - import 'bar.dart'; - bar.dart: "" - - main.dart: | - class foo { } - export 'bar.dart'; - bar.dart: "" - NonPartOfDirectiveInPart: parameters: none problemMessage: "The part-of directive must be the only directive in a part." @@ -4749,32 +3122,6 @@ script: - "part of l; part 'f.dart';" -PartOfTwice: - parameters: none - index: 25 - problemMessage: "Only one part-of directive may be declared in a file." - correctionMessage: "Try removing all but one of the part-of directives." - analyzerCode: ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES - script: - - main.dart: | - part "part.dart"; - main() {} - other.dart: "" - part.dart: | - part of "other.dart"; - part of "main.dart"; - - main.dart: | - part of "lib.dart"; - part of "lib.dart"; - main() {} - lib.dart: | - part "main.dart"; - - main.dart: | - part "part.dart"; - part.dart: | - part of "main.dart"; - part of "main.dart"; - PartTwice: parameters: Uri uri: undocumented @@ -4799,36 +3146,6 @@ problemMessage: "Used as a part in this library." severity: CONTEXT -FactoryTopLevelDeclaration: - parameters: none - index: 78 - problemMessage: "Top-level declarations can't be declared to be 'factory'." - correctionMessage: "Try removing the keyword 'factory'." - analyzerCode: ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION - script: - - "factory class C {}" - -RedirectionInNonFactory: - parameters: none - index: 21 - problemMessage: "Only factory constructor can specify '=' redirection." - correctionMessage: "Try making this a factory constructor, or remove the redirection." - analyzerCode: ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR - script: - - "class C { C() = D; }" - exampleAllowOtherCodes: true - -TopLevelOperator: - parameters: none - index: 14 - problemMessage: "Operators must be declared within a class." - correctionMessage: "Try removing the operator, moving it to a class, or converting it to be a function." - analyzerCode: ParserErrorCode.TOP_LEVEL_OPERATOR - 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: parameters: none problemMessage: "A function declaration needs an explicit list of parameters." @@ -4953,31 +3270,6 @@ problemMessage: "'#name' is used here." severity: CONTEXT -TypeArgumentsOnTypeVariable: - parameters: - Name name: undocumented - index: 13 - problemMessage: "Can't use type arguments with type variable '#name'." - correctionMessage: "Try removing the type arguments." - analyzerCode: ParserErrorCode.TYPE_ARGUMENTS_ON_TYPE_VARIABLE - script: - - "void method<S>(S<int> a) {}" - -# Use this message when a duplicated declaration is introduced. For example: -# -# class C {} // First declaration (related information points here). -# class C {} // Duplicated declaration (error here). -# main() { -# new C(); // Use of duplicated declaration. -# } -# -# We follow the convention from C that a definition is the unique element that -# provides the implementation of a name, and a declaration may not be unique -# (for example, forward declaration). Using this terminology, one could argue -# that a method that is abstract or external is a declaration, not a -# definition. Similarly, imported names are declarations, not -# definitions. Consequently, it is more convenient to use the word -# "declaration" instead of "definition" as the former implies less. DuplicatedDeclaration: parameters: Name name: undocumented @@ -5055,41 +3347,6 @@ problemMessage: "Other parameter named '#name'." severity: CONTEXT -MemberWithSameNameAsClass: - parameters: none - problemMessage: "A class member can't have the same name as the enclosing class." - correctionMessage: "Try renaming the member." - analyzerCode: ParserErrorCode.MEMBER_WITH_CLASS_NAME - index: 105 - script: - - "class C { get C {} }" - - "class C { get C => 42; }" - - "class C { set C(x) {} }" - - "class C { set C(x) => 42; }" - - "class C { int? C; }" - - "class C { int? A, B, C, D, E; }" - -MissingOperatorKeyword: - parameters: none - index: 31 - problemMessage: "Operator declarations must be preceded by the keyword 'operator'." - correctionMessage: "Try adding the keyword 'operator'." - analyzerCode: ParserErrorCode.MISSING_KEYWORD_OPERATOR - script: - - "class C { +(x) {} }" - -InvalidOperator: - parameters: - Token lexeme: undocumented - index: 39 - problemMessage: "The string '#lexeme' isn't a user-definable operator." - analyzerCode: ParserErrorCode.INVALID_OPERATOR - comment: |- - Parameters: - 0: the operator that is invalid - script: - - "class C { void operator %=(x) {} }" - NotBinaryOperator: parameters: Token lexeme: undocumented @@ -5287,18 +3544,6 @@ problemMessage: "SDK libraries specification not found: #uri." correctionMessage: "Normally, the specification is a file named 'libraries.json' in the Dart SDK install location." -InvalidSuperInInitializer: - parameters: none - index: 47 - problemMessage: "Can only use 'super' in an initializer for calling the superclass constructor (e.g. 'super()' or 'super.namedConstructor()')" - analyzerCode: ParserErrorCode.INVALID_SUPER_IN_INITIALIZER - -InvalidThisInInitializer: - parameters: none - index: 65 - problemMessage: "Can only use 'this' in an initializer for field initialization (e.g. 'this.x = something') and constructor redirection (e.g. 'this()' or 'this.namedConstructor())" - analyzerCode: ParserErrorCode.INVALID_THIS_IN_INITIALIZER - ThisAccessInFieldInitializer: parameters: Name name: undocumented @@ -5376,24 +3621,6 @@ } } -SwitchHasCaseAfterDefault: - parameters: none - index: 16 - problemMessage: "The default case should be the last case in a switch statement." - correctionMessage: "Try moving the default case after the other case clauses." - analyzerCode: ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE - script: - - "class C { foo(int a) {switch (a) {default: return 0; case 1: return 1;}} }" - -SwitchHasMultipleDefaults: - parameters: none - index: 15 - problemMessage: "The 'default' case can only be declared once." - correctionMessage: "Try removing all but one default case." - analyzerCode: ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES - script: - - "class C { foo(int a) {switch (a) {default: return 0; default: return 1;}} }" - SwitchCaseFallThrough: parameters: none problemMessage: "Switch case may fall through to the next case." @@ -5633,34 +3860,6 @@ @foo void foo() {} -ExpectedAnInitializer: - parameters: none - index: 36 - problemMessage: "Expected an initializer." - analyzerCode: ParserErrorCode.MISSING_INITIALIZER - script: - - "class C { C() : {} }" - -MissingAssignmentInInitializer: - parameters: none - index: 34 - problemMessage: "Expected an assignment after the field name." - correctionMessage: "To initialize a field, use the syntax 'name = value'." - analyzerCode: ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER - script: - - "class C { C() : x(3) {} }" - exampleAllowOtherCodes: true - -RedirectingConstructorWithBody: - parameters: none - index: 22 - problemMessage: "Redirecting constructors can't have a body." - correctionMessage: "Try removing the body, or not making this a redirecting constructor." - analyzerCode: ParserErrorCode.REDIRECTING_CONSTRUCTOR_WITH_BODY - script: - - "class C { C() : this.x() {} }" - exampleAllowOtherCodes: true - CannotAssignToParenthesizedExpression: parameters: none problemMessage: "Can't assign to a parenthesized expression." @@ -5688,23 +3887,6 @@ problemMessage: "Can't assign to super." analyzerCode: NOT_AN_LVALUE -IllegalAssignmentToNonAssignable: - parameters: none - index: 45 - problemMessage: "Illegal assignment to non-assignable expression." - analyzerCode: ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE - script: - - "main(){ f()++; }" - -MissingAssignableSelector: - parameters: none - index: 35 - problemMessage: "Missing selector such as '.identifier' or '[0]'." - correctionMessage: "Try adding a selector." - analyzerCode: ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR - script: - - "main(){ ++f(); }" - CannotReadSdkSpecification: parameters: String string: undocumented @@ -5773,40 +3955,6 @@ int i = 9223372036854775808; } -ColonInPlaceOfIn: - parameters: none - index: 54 - problemMessage: "For-in loops use 'in' rather than a colon." - correctionMessage: "Try replacing the colon with the keyword 'in'." - analyzerCode: ParserErrorCode.COLON_IN_PLACE_OF_IN - script: | - void foo() { - for(var x : []) {} - } - -BinaryOperatorWrittenOut: - parameters: - String string: undocumented - String string2: undocumented - index: 112 - problemMessage: "Binary operator '#string' is written as '#string2' instead of the written out word." - correctionMessage: "Try replacing '#string' with '#string2'." - analyzerCode: ParserErrorCode.BINARY_OPERATOR_WRITTEN_OUT - script: | - int foo(int x, int y) => x xor y; - -ExternalFactoryRedirection: - parameters: none - index: 85 - problemMessage: "A redirecting factory can't be external." - correctionMessage: "Try removing the 'external' modifier." - analyzerCode: ParserErrorCode.EXTERNAL_FACTORY_REDIRECTION - script: | - class Foo { - Foo._(int i); - external factory Foo.x(int i) = Foo._; - } - ArgumentTypeNotAssignable: parameters: Type type: undocumented @@ -7593,17 +5741,6 @@ main.dart: "import 'lib.dart' deferred as prefix;" lib.dart: "extension Extension on void {}" -MultipleVarianceModifiers: - parameters: none - index: 97 - problemMessage: "Each type parameter can have at most one variance modifier." - correctionMessage: "Use at most one of the 'in', 'out', or 'inout' modifiers." - analyzerCode: ParserErrorCode.MULTIPLE_VARIANCE_MODIFIERS - experiments: variance - script: | - class C<in out X> {} - - VariableCouldBeNullDueToWrite: parameters: Name name: undocumented @@ -8949,96 +7086,6 @@ lib.dart: class A {} -BaseEnum: - parameters: none - index: 155 - problemMessage: "Enums can't be declared to be 'base'." - correctionMessage: "Try removing the keyword 'base'." - analyzerCode: ParserErrorCode.BASE_ENUM - script: - - "base enum E { v }" - -FinalEnum: - parameters: none - index: 156 - problemMessage: "Enums can't be declared to be 'final'." - correctionMessage: "Try removing the keyword 'final'." - analyzerCode: ParserErrorCode.FINAL_ENUM - script: - - "final enum E { v }" - -InterfaceEnum: - parameters: none - index: 157 - problemMessage: "Enums can't be declared to be 'interface'." - correctionMessage: "Try removing the keyword 'interface'." - analyzerCode: ParserErrorCode.INTERFACE_ENUM - script: - - "interface enum E { v }" - -SealedEnum: - parameters: none - index: 158 - problemMessage: "Enums can't be declared to be 'sealed'." - correctionMessage: "Try removing the keyword 'sealed'." - analyzerCode: ParserErrorCode.SEALED_ENUM - script: - - "sealed enum E { v }" - -FinalMixin: - parameters: none - index: 146 - problemMessage: "A mixin can't be declared 'final'." - correctionMessage: "Try removing the 'final' keyword." - analyzerCode: ParserErrorCode.FINAL_MIXIN - script: - - "final mixin M {}" - -InterfaceMixin: - parameters: none - index: 147 - problemMessage: "A mixin can't be declared 'interface'." - correctionMessage: "Try removing the 'interface' keyword." - analyzerCode: ParserErrorCode.INTERFACE_MIXIN - script: - - "interface mixin M {}" - -SealedMixin: - parameters: none - index: 148 - problemMessage: "A mixin can't be declared 'sealed'." - correctionMessage: "Try removing the 'sealed' keyword." - analyzerCode: ParserErrorCode.SEALED_MIXIN - script: - - "sealed mixin M {}" - -FinalMixinClass: - parameters: none - index: 142 - problemMessage: "A mixin class can't be declared 'final'." - correctionMessage: "Try removing the 'final' keyword." - analyzerCode: ParserErrorCode.FINAL_MIXIN_CLASS - script: - - "final mixin class C {}" - -InterfaceMixinClass: - parameters: none - index: 143 - problemMessage: "A mixin class can't be declared 'interface'." - correctionMessage: "Try removing the 'interface' keyword." - analyzerCode: ParserErrorCode.INTERFACE_MIXIN_CLASS - script: - - "interface mixin class C {}" - -SealedMixinClass: - parameters: none - index: 144 - problemMessage: "A mixin class can't be declared 'sealed'." - correctionMessage: "Try removing the 'sealed' keyword." - analyzerCode: ParserErrorCode.SEALED_MIXIN_CLASS - script: - - "sealed mixin class C {}" - BaseClassImplementedOutsideOfLibrary: parameters: Name name: undocumented @@ -9336,99 +7383,6 @@ if (x case int(5)) {} } -InvalidConstantPatternNegation: - parameters: none - problemMessage: "Only negation of a numeric literal is supported as a constant pattern." - correctionMessage: "Try wrapping the expression in 'const ( ... )'." - analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_NEGATION - index: 135 - script: | - method(x) { - const y = 5; - if (x case -y) {} - } - -InvalidConstantPatternUnary: - parameters: - Name name: undocumented - problemMessage: "The unary operator #name is not supported as a constant pattern." - correctionMessage: "Try wrapping the expression in 'const ( ... )'." - analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_UNARY - index: 136 - script: | - method(x) { - const y = false; - if (x case !y) {} - } - -InvalidConstantPatternDuplicateConst: - parameters: none - problemMessage: "Duplicate 'const' keyword in constant expression." - correctionMessage: "Try removing one of the 'const' keywords." - analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_DUPLICATE_CONST - index: 137 - script: | - method(x) { - if (x case const const []) {} - } - -InvalidConstantPatternEmptyRecordLiteral: - parameters: none - problemMessage: "The empty record literal is not supported as a constant pattern." - analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_EMPTY_RECORD_LITERAL - index: 138 - script: | - method(x) { - if (x case const ()) {} - } - -InvalidConstantPatternGeneric: - parameters: none - problemMessage: "This expression is not supported as a constant pattern." - correctionMessage: "Try wrapping the expression in 'const ( ... )'." - analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_GENERIC - index: 139 - script: | - method(x) { - if (x case List<int>) {} - } - -InvalidConstantPatternConstPrefix: - parameters: none - problemMessage: "The expression can't be prefixed by 'const' to form a constant pattern." - correctionMessage: "Try wrapping the expression in 'const ( ... )' instead." - analyzerCode: ParserErrorCode.INVALID_CONSTANT_CONST_PREFIX - index: 140 - script: | - method(x) { - if (x case const 1) {} - } - -InvalidConstantPatternBinary: - parameters: - Name name: undocumented - problemMessage: "The binary operator #name is not supported as a constant pattern." - correctionMessage: "Try wrapping the expression in 'const ( ... )'." - analyzerCode: ParserErrorCode.INVALID_CONSTANT_PATTERN_BINARY - index: 141 - script: | - method(x) { - if (x case 1 + 2) {} - } - -PatternAssignmentDeclaresVariable: - parameters: - Name name: undocumented - problemMessage: "Variable '#name' can't be declared in a pattern assignment." - correctionMessage: "Try using a preexisting variable or changing the assignment to a pattern variable declaration." - analyzerCode: ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE - index: 145 - script: | - method(x) { - var y; - [y, var z] = x; - } - PatternAssignmentNotLocalVariable: parameters: none problemMessage: Only local variables or formal parameters can be used in pattern assignments. @@ -9440,148 +7394,6 @@ [global] = x; } -VariablePatternKeywordInDeclarationContext: - parameters: none - problemMessage: Variable patterns in declaration context can't specify 'var' or 'final' keyword. - correctionMessage: Try removing the keyword. - analyzerCode: ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT - index: 149 - comment: No parameters. - hasPublishedDocs: true - script: | - void f((int, int) r) { - var (var x, y) = r; - print(x + y); - } - documentation: |- - #### Description - - The analyzer produces this diagnostic when a variable pattern is used - within a declaration context. - - #### Example - - The following code produces this diagnostic because the variable patterns - in the record pattern are in a declaration context: - - ```dart - void f((int, int) r) { - var ([!var!] x, y) = r; - print(x + y); - } - ``` - - #### Common fixes - - Remove the `var` or `final` keyword(s) within the variable pattern: - - ```dart - void f((int, int) r) { - var (x, y) = r; - print(x + y); - } - ``` - -IllegalPatternVariableName: - parameters: - Token lexeme: undocumented - problemMessage: The variable declared by a variable pattern can't be named '#lexeme'. - correctionMessage: Choose a different name. - analyzerCode: ParserErrorCode.ILLEGAL_PATTERN_VARIABLE_NAME - index: 159 - comment: |- - Parameters: - 0: the illegal name - script: | - void f(x) { - switch (x) { - case var when: - } - } - -IllegalPatternAssignmentVariableName: - parameters: - Token lexeme: undocumented - problemMessage: A variable assigned by a pattern assignment can't be named '#lexeme'. - correctionMessage: Choose a different name. - analyzerCode: ParserErrorCode.ILLEGAL_PATTERN_ASSIGNMENT_VARIABLE_NAME - index: 160 - comment: |- - Parameters: - 0: the illegal name - script: | - void f(x) { - dynamic when; - (when) = x; - } - -IllegalPatternIdentifierName: - parameters: - Token lexeme: undocumented - problemMessage: A pattern can't refer to an identifier named '#lexeme'. - correctionMessage: Match the identifier using '== #lexeme'. - analyzerCode: ParserErrorCode.ILLEGAL_PATTERN_IDENTIFIER_NAME - index: 161 - comment: |- - Parameters: - 0: the illegal name - script: | - void f(x) { - const when = 0; - switch (x) { - case when: - } - } - -InvalidInsideUnaryPattern: - parameters: none - problemMessage: This pattern cannot appear inside a unary pattern (cast pattern, null check pattern, or null assert pattern) without parentheses. - correctionMessage: Try combining into a single pattern if possible, or enclose the inner pattern in parentheses. - analyzerCode: ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN - index: 150 - comment: No parameters. - script: | - void f(x) { - if (x case _ as int as num) {} - } - -LatePatternVariableDeclaration: - parameters: none - problemMessage: A pattern variable declaration may not use the `late` keyword. - correctionMessage: Try removing the keyword `late`. - analyzerCode: ParserErrorCode.LATE_PATTERN_VARIABLE_DECLARATION - index: 151 - comment: No parameters. - script: | - void f(x) { - late var (y, z) = x; - } - -PatternVariableDeclarationOutsideFunctionOrMethod: - parameters: none - problemMessage: A pattern variable declaration may not appear outside a function or method. - correctionMessage: Try declaring ordinary variables and assigning from within a function or method. - analyzerCode: ParserErrorCode.PATTERN_VARIABLE_DECLARATION_OUTSIDE_FUNCTION_OR_METHOD - index: 152 - comment: No parameters. - script: | - class C { - var (a, b) = (0, 1); - } - -DefaultInSwitchExpression: - parameters: none - problemMessage: A switch expression may not use the `default` keyword. - correctionMessage: Try replacing `default` with `_`. - analyzerCode: ParserErrorCode.DEFAULT_IN_SWITCH_EXPRESSION - index: 153 - comment: No parameters. - script: | - void f(x) => switch (x) { - 1 => 'one', - default => 'other' - }; - RecordUseCannotBePlacedHere: parameters: none problemMessage: "`RecordUse` annotation cannot be placed on this element." @@ -9759,44 +7571,6 @@ extension type E1(int i) {} extension type E2(num n) implements E1 {} -MissingPrimaryConstructor: - parameters: none - problemMessage: "An extension type declaration must have a primary constructor declaration." - correctionMessage: "Try adding a primary constructor to the extension type declaration." - index: 162 - analyzerCode: ParserErrorCode.MISSING_PRIMARY_CONSTRUCTOR - script: | - extension type E {} - -MissingPrimaryConstructorParameters: - parameters: none - problemMessage: "A primary constructor declaration must have formal parameters." - correctionMessage: "Try adding formal parameters after the primary constructor name." - index: 163 - analyzerCode: ParserErrorCode.MISSING_PRIMARY_CONSTRUCTOR_PARAMETERS - script: | - extension type E.name {} - -ExtensionTypeExtends: - parameters: none - problemMessage: "An extension type declaration can't have an 'extends' clause." - correctionMessage: "Try removing the 'extends' clause or replacing the 'extends' with 'implements'." - index: 164 - analyzerCode: ParserErrorCode.EXTENSION_TYPE_EXTENDS - script: | - extension type F(int i) {} - extension type E(int i) extends F {} - -ExtensionTypeWith: - parameters: none - problemMessage: "An extension type declaration can't have a 'with' clause." - correctionMessage: "Try removing the 'with' clause or replacing the 'with' with 'implements'." - index: 165 - analyzerCode: ParserErrorCode.EXTENSION_TYPE_WITH - script: | - extension type F(int i) {} - extension type E(int i) with F {} - LocalVariableUsedBeforeDeclared: parameters: Name name: undocumented
diff --git a/pkg/front_end/presubmit_helper.dart b/pkg/front_end/presubmit_helper.dart index ffc08e4..1dd2964 100644 --- a/pkg/front_end/presubmit_helper.dart +++ b/pkg/front_end/presubmit_helper.dart
@@ -85,6 +85,7 @@ "pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart", "pkg/_fe_analyzer_shared/lib/src/parser/listener.dart", "pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart", + "pkg/_fe_analyzer_shared/messages.yaml", "pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart", "pkg/front_end/lib/src/codes/cfe_codes_generated.dart", "pkg/front_end/lib/src/util/parser_ast_helper.dart", @@ -201,17 +202,21 @@ return new LintWork(filters: filters, repoDir: _repoDir); } +final RegExp _messagesYamlPathRegExp = RegExp('^pkg/(.+)/messages.yaml\$'); + MessagesWork? _createMessagesTestWork(List<String> changedFiles) { // TODO(jensj): Could we detect what ones are changed/added and only test // those? + List<String> filters = []; for (String file in changedFiles) { - if (file == "pkg/front_end/messages.yaml") { - return new MessagesWork(repoDir: _repoDir); + if (_messagesYamlPathRegExp.matchAsPrefix(file) case var match?) { + filters.add('messages/${match.group(1)}/...'); } } - // messages.yaml not changed. - return null; + if (filters.isEmpty) return null; + + return new MessagesWork(filters: filters, repoDir: _repoDir); } SpellNotSourceWork? _createSpellingTestNotSourceWork( @@ -555,9 +560,10 @@ } class MessagesWork extends Work { + final List<String> filters; final Uri repoDir; - MessagesWork({required this.repoDir}); + MessagesWork({required this.filters, required this.repoDir}); @override String get name => "messages test"; @@ -566,12 +572,16 @@ Map<String, Object?> toJson() { return { "WorkTypeIndex": WorkEnum.Messages.index, + "filters": filters, "repoDir": repoDir.toString(), }; } static Work fromJson(Map<String, Object?> json) { - return new MessagesWork(repoDir: Uri.parse(json["repoDir"] as String)); + return new MessagesWork( + filters: List<String>.from(json["filters"] as Iterable), + repoDir: Uri.parse(json["repoDir"] as String), + ); } }
diff --git a/pkg/front_end/presubmit_helper_spawn.dart b/pkg/front_end/presubmit_helper_spawn.dart index 62b54bc..d92527e 100644 --- a/pkg/front_end/presubmit_helper_spawn.dart +++ b/pkg/front_end/presubmit_helper_spawn.dart
@@ -89,7 +89,7 @@ ok = await Isolate.run(() async { ErrorNotingLogger logger = new ErrorNotingLogger(); await testing.runMe( - const ["-DfastOnly=true"], + ["-DfastOnly=true", "--", ...work.filters], messages_suite.createContext, me: work.repoDir.resolve( "pkg/front_end/test/messages_suite.dart",
diff --git a/pkg/front_end/test/messages_suite.dart b/pkg/front_end/test/messages_suite.dart index 7d367e4..8de27db 100644 --- a/pkg/front_end/test/messages_suite.dart +++ b/pkg/front_end/test/messages_suite.dart
@@ -2,7 +2,7 @@ // 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. -import "dart:convert" show utf8; +import "dart:convert" show utf8, json; import 'dart:io' show File, Platform; import "dart:typed_data" show Uint8List; @@ -152,7 +152,32 @@ @override Future<List<MessageTestDescription>> list(Chain suite) { List<MessageTestDescription> result = []; - Uri uri = suite.root.resolve("messages.yaml"); + var rootString = suite.root.toString(); + for (var subRoot in suite.subRoots) { + var subRootString = subRoot.toString(); + if (!subRootString.startsWith(rootString)) { + throw StateError( + 'Expected sub-root ${json.encode(subRootString)} to start with ' + '${json.encode(rootString)}', + ); + } + if (!subRootString.endsWith('/')) { + throw StateError( + 'Expected sub-root ${json.encode(subRootString)} to end with "/"', + ); + } + var prefix = subRootString.substring(rootString.length); + result.addAll(_ListSubRoot(subRoot, prefix: prefix)); + } + return Future.value(result); + } + + List<MessageTestDescription> _ListSubRoot( + Uri root, { + required String prefix, + }) { + List<MessageTestDescription> result = []; + Uri uri = root.resolve("messages.yaml"); File file = new File.fromUri(uri); String fileContent = file.readAsStringSync(); YamlMap messages = loadYamlNode(fileContent, sourceUrl: uri) as YamlMap; @@ -500,7 +525,7 @@ ({String message, KnownExpectation expectation})? problem, { location, }) { - String shortName = "$name/$subName"; + String shortName = "$prefix$name/$subName"; if (problem != null) { String filename = relativize(uri); location ??= message.span.start; @@ -634,15 +659,13 @@ null, exampleAndAnalyzerCodeRequired && externalTest != null && - !(new File.fromUri( - suite.root.resolve(externalTest), - ).existsSync()) + !(new File.fromUri(root.resolve(externalTest)).existsSync()) ? ( expectation: KnownExpectation.missingExternalFile, message: "Given external example for $name points to a " "nonexisting file " - "(${suite.root.resolve(externalTest)}).", + "(${root.resolve(externalTest)}).", ) : null, ), @@ -684,7 +707,7 @@ ), ); } - return Future.value(result); + return result; } String formatProblems(
diff --git a/pkg/front_end/testing.json b/pkg/front_end/testing.json index 699e1ae..fd1775b 100644 --- a/pkg/front_end/testing.json +++ b/pkg/front_end/testing.json
@@ -8,7 +8,11 @@ "name": "messages", "kind": "Chain", "source": "test/messages_suite.dart", - "root": "./", + "root": "../", + "subRoots": [ + "_fe_analyzer_shared/", + "front_end/" + ], "status": "messages.status" }, {
diff --git a/pkg/front_end/tool/generate_messages_lib.dart b/pkg/front_end/tool/generate_messages_lib.dart index c069b19..8e91c69 100644 --- a/pkg/front_end/tool/generate_messages_lib.dart +++ b/pkg/front_end/tool/generate_messages_lib.dart
@@ -69,9 +69,9 @@ int largestIndex = 0; final indexNameMap = new Map<int, String>(); - List<String> keys = frontEndMessages.keys.toList()..sort(); + List<String> keys = frontEndAndSharedMessages.keys.toList()..sort(); for (String name in keys) { - var errorCodeInfo = frontEndMessages[name]!; + var errorCodeInfo = frontEndAndSharedMessages[name]!; var index = errorCodeInfo.index; if (index != null) { String? otherName = indexNameMap[index]; @@ -175,7 +175,7 @@ _TemplateCompiler({ required this.name, required this.index, - required FrontEndErrorCodeInfo errorCodeInfo, + required CfeStyleErrorCodeInfo errorCodeInfo, }) : problemMessage = errorCodeInfo.problemMessage, correctionMessage = errorCodeInfo.correctionMessage, analyzerCodes = errorCodeInfo.analyzerCode,
diff --git a/runtime/vm/bytecode_reader.cc b/runtime/vm/bytecode_reader.cc index 277472e..3ae4741 100644 --- a/runtime/vm/bytecode_reader.cc +++ b/runtime/vm/bytecode_reader.cc
@@ -2902,6 +2902,13 @@ #if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) +const char* BytecodeLocalVariablesIterator::kKindNames[] = { + "Invalid", + "Scope", + "VariableDeclaration", + "ContextVariable", +}; + LocalVarDescriptorsPtr BytecodeReader::ComputeLocalVarDescriptors( Zone* zone, const Function& function,
diff --git a/runtime/vm/bytecode_reader.h b/runtime/vm/bytecode_reader.h index 180b58c..532b3b9 100644 --- a/runtime/vm/bytecode_reader.h +++ b/runtime/vm/bytecode_reader.h
@@ -594,6 +594,7 @@ kContextVariable, }; + static const char* kKindNames[]; static const intptr_t kKindMask = 0xF; static const intptr_t kIsCapturedFlag = 1 << 4; @@ -641,6 +642,7 @@ bool IsDone() const { return entries_remaining_ < 0; } intptr_t Kind() const { return cur_kind_and_flags_ & kKindMask; } + const char* KindName() const { return kKindNames[Kind()]; } bool IsScope() const { return Kind() == kScope; } bool IsVariableDeclaration() const { return Kind() == kVariableDeclaration; } bool IsContextVariable() const { return Kind() == kContextVariable; }
diff --git a/runtime/vm/compiler/assembler/disassembler_kbc.cc b/runtime/vm/compiler/assembler/disassembler_kbc.cc index 1f65699..1807619 100644 --- a/runtime/vm/compiler/assembler/disassembler_kbc.cc +++ b/runtime/vm/compiler/assembler/disassembler_kbc.cc
@@ -354,6 +354,23 @@ #endif } +#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) +static const int kLocalVariableKindMaxWidth = strlen( + bytecode::BytecodeLocalVariablesIterator::kKindNames + [bytecode::BytecodeLocalVariablesIterator::kVariableDeclaration]); + +static const int kLocalVariableColumnWidths[] = { + kLocalVariableKindMaxWidth, // kind + 14, // start pc + 14, // end pc + 7, // context level + 7, // index + 7, // start token pos + 7, // end token pos + 7, // decl token pos +}; +#endif + void KernelBytecodeDisassembler::Disassemble(const Function& function) { #if !defined(PRODUCT) ASSERT(function.HasBytecode()); @@ -397,6 +414,69 @@ THR_Print("}\n"); } + if (bytecode.HasLocalVariablesInfo()) { +#if !defined(DART_PRECOMPILED_RUNTIME) + auto& name = String::Handle(zone); + auto& type = AbstractType::Handle(zone); + THR_Print("Local variable information for function '%s' {\n", + function_fullname); + // "*" in a printf format specifier tells it to read the field width from + // the printf argument list. + THR_Print( + " %*s %*s %*s %*s %*s %*s %*s %*s name\n", + kLocalVariableColumnWidths[0], "kind", kLocalVariableColumnWidths[1], + "start pc", kLocalVariableColumnWidths[2], "end pc", + kLocalVariableColumnWidths[3], "ctx", kLocalVariableColumnWidths[4], + "index", kLocalVariableColumnWidths[5], "start", + kLocalVariableColumnWidths[6], "end", kLocalVariableColumnWidths[7], + "decl"); + bytecode::BytecodeLocalVariablesIterator iter(zone, bytecode); + while (iter.MoveNext()) { + THR_Print(" %*s %-#*" Px "", kLocalVariableColumnWidths[0], + iter.KindName(), kLocalVariableColumnWidths[1], + base + iter.StartPC()); + if (iter.IsVariableDeclaration() || iter.IsScope()) { + THR_Print(" %-#*" Px "", kLocalVariableColumnWidths[2], + base + iter.EndPC()); + } else { + THR_Print(" %*s", kLocalVariableColumnWidths[2], ""); + } + if (iter.IsScope()) { + THR_Print(" %*" Pd "", kLocalVariableColumnWidths[3], + iter.ContextLevel()); + } else { + THR_Print(" %*s", kLocalVariableColumnWidths[3], ""); + } + if (iter.IsContextVariable() || iter.IsVariableDeclaration()) { + THR_Print(" %*" Pd "", kLocalVariableColumnWidths[4], iter.Index()); + } else { + THR_Print(" %*s", kLocalVariableColumnWidths[4], ""); + } + if (iter.IsVariableDeclaration() || iter.IsScope()) { + THR_Print(" %*s %*s", kLocalVariableColumnWidths[5], + iter.StartTokenPos().ToCString(), + kLocalVariableColumnWidths[6], + iter.EndTokenPos().ToCString()); + + } else { + THR_Print(" %*s %*s", kLocalVariableColumnWidths[5], "", + kLocalVariableColumnWidths[6], ""); + } + if (iter.IsVariableDeclaration()) { + name = iter.Name(); + type = iter.Type(); + THR_Print(" %*s %s: %s%s", kLocalVariableColumnWidths[7], + iter.DeclarationTokenPos().ToCString(), name.ToCString(), + type.ToCString(), iter.IsCaptured() ? " (captured)" : ""); + } + THR_Print("\n"); + } + THR_Print("}\n"); +#else + UNREACHABLE(); +#endif + } + THR_Print("Exception Handlers for function '%s' {\n", function_fullname); const ExceptionHandlers& handlers = ExceptionHandlers::Handle(zone, bytecode.exception_handlers());
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc index f40be9c..689595d 100644 --- a/runtime/vm/debugger.cc +++ b/runtime/vm/debugger.cc
@@ -636,7 +636,15 @@ OS::PrintErr("deopt_id_ %" Px "\n", deopt_id_); OS::PrintErr("context_level_ %" Px "\n", context_level_); OS::PrintErr("token_pos_ %s\n", token_pos_.ToCString()); - { + if (IsInterpreted()) { +#if defined(DART_DYNAMIC_MODULES) + DisassembleToStdout formatter; + bytecode().Disassemble(&formatter); + OS::PrintErr("%s\n", var_descriptors_.ToCString()); +#else + UNREACHABLE(); +#endif + } else { DisassembleToStdout formatter; code().Disassemble(&formatter); PcDescriptors::Handle(code().pc_descriptors()).Print(); @@ -658,24 +666,51 @@ const Context& ctx = GetSavedCurrentContext(); if (context_level_ < 0 && !ctx.IsNull()) { ASSERT(IsInterpreted() || !code().is_optimized()); - GetVarDescriptors(); - intptr_t deopt_id = DeoptId(); - if (deopt_id == DeoptId::kNone) { - PrintDescriptorsError("Missing deopt id"); - } - intptr_t var_desc_len = var_descriptors_.Length(); bool found = false; - // We store the deopt ids as real token positions. - const auto to_compare = TokenPosition::Deserialize(deopt_id); - for (intptr_t cur_idx = 0; cur_idx < var_desc_len; cur_idx++) { - UntaggedLocalVarDescriptors::VarInfo var_info; - var_descriptors_.GetInfo(cur_idx, &var_info); - const int8_t kind = var_info.kind(); - if ((kind == UntaggedLocalVarDescriptors::kContextLevel) && - to_compare.IsWithin(var_info.begin_pos, var_info.end_pos)) { - context_level_ = var_info.index(); - found = true; - break; + if (IsInterpreted()) { +#if defined(DART_DYNAMIC_MODULES) && !defined(PRODUCT) && \ + !defined(DART_PRECOMPILED_RUNTIME) + const intptr_t pc_offset = pc() - PayloadStart(); + DEBUG_ONLY(intptr_t closest_start = 0); + bytecode::BytecodeLocalVariablesIterator local_vars( + Thread::Current()->zone(), bytecode()); + while (local_vars.MoveNext()) { + if (local_vars.IsScope()) { + if (local_vars.StartPC() <= pc_offset && + pc_offset < local_vars.EndPC()) { + DEBUG_ASSERT(!found || local_vars.StartPC() > closest_start); + found = true; + context_level_ = local_vars.ContextLevel(); + DEBUG_ONLY(closest_start = local_vars.StartPC()); + } else if (local_vars.StartPC() > pc_offset) { + // The scopes in the local variables info are ordered by starting + // PC offset, so no need to search further. + break; + } + } + } +#else + UNREACHABLE(); +#endif + } else { + GetVarDescriptors(); + intptr_t var_desc_len = var_descriptors_.Length(); + // We store the deopt ids as real token positions. + intptr_t deopt_id = DeoptId(); + if (deopt_id == DeoptId::kNone) { + PrintDescriptorsError("Missing deopt id"); + } + const TokenPosition to_compare = TokenPosition::Deserialize(deopt_id); + for (intptr_t cur_idx = 0; cur_idx < var_desc_len; cur_idx++) { + UntaggedLocalVarDescriptors::VarInfo var_info; + var_descriptors_.GetInfo(cur_idx, &var_info); + const int8_t kind = var_info.kind(); + if ((kind == UntaggedLocalVarDescriptors::kContextLevel) && + to_compare.IsWithin(var_info.begin_pos, var_info.end_pos)) { + context_level_ = var_info.index(); + found = true; + break; + } } } if (!found) { @@ -3091,6 +3126,16 @@ "ResumptionBreakpoint - hit a breakpoint, continue single " "stepping\n"); } +#if defined(DART_DYNAMIC_MODULES) + if (top_frame->IsInterpreted()) { + // The interpreter calls the single step handler on every instruction, + // so set the last stepping fp/position to the current fp/position when + // stepping over so the debugger doesn't pause until it reaches + // a _new_ source position. + last_stepping_fp_ = top_frame->fp(); + last_stepping_pos_ = top_frame->TokenPos(); + } +#endif EnterSingleStepMode(); return; } @@ -3416,6 +3461,12 @@ stepping_fp_ = frame->fp(); #if defined(DART_DYNAMIC_MODULES) stepping_fp_from_interpreted_frame_ = frame->IsInterpreted(); + // The interpreter calls the single step handler on every instruction, + // so set the last stepping fp/position to the current fp/position when + // stepping over so the debugger doesn't pause until it reaches + // a _new_ source position. + last_stepping_fp_ = frame->fp(); + last_stepping_pos_ = frame->TokenPos(); #endif } else { stepping_fp_ = 0;
diff --git a/runtime/vm/object.h b/runtime/vm/object.h index 255f891..eeebf08 100644 --- a/runtime/vm/object.h +++ b/runtime/vm/object.h
@@ -7601,9 +7601,6 @@ void set_local_variables_binary_offset(intptr_t value) const { StoreNonPointer(&untag()->local_variables_binary_offset_, value); } - bool HasLocalVariablesInfo() const { - return (local_variables_binary_offset() != 0); - } LocalVarDescriptorsPtr var_descriptors() const { return untag()->var_descriptors<std::memory_order_acquire>(); @@ -7616,6 +7613,15 @@ // Will compute local var descriptors if necessary. LocalVarDescriptorsPtr GetLocalVarDescriptors() const; #endif // !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) + + bool HasLocalVariablesInfo() const { +#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) + return (local_variables_binary_offset() != 0); +#else + return false; +#endif + } + const char* Name() const; const char* QualifiedName() const; const char* FullyQualifiedName() const;
diff --git a/tools/VERSION b/tools/VERSION index 929047c..2304e9e1 100644 --- a/tools/VERSION +++ b/tools/VERSION
@@ -27,5 +27,5 @@ MAJOR 3 MINOR 10 PATCH 0 -PRERELEASE 203 +PRERELEASE 204 PRERELEASE_PATCH 0