diff --git a/pkg/analysis_server/lib/src/edit/fix/fix_error_task.dart b/pkg/analysis_server/lib/src/edit/fix/fix_error_task.dart index 7fc3e1ef8e2..d15e724011f 100644 --- a/pkg/analysis_server/lib/src/edit/fix/fix_error_task.dart +++ b/pkg/analysis_server/lib/src/edit/fix/fix_error_task.dart @@ -65,7 +65,7 @@ class FixErrorTask { static void fixNamedConstructorTypeArgs(DartFixRegistrar registrar, DartFixListener listener, EditDartfixParams params) { registrar.registerErrorTask( - StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, FixErrorTask(listener)); } } diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart index b9c34974e4c..332b3f585f3 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix.dart @@ -14,8 +14,11 @@ import 'package:analyzer_plugin/utilities/fixes/fixes.dart'; /// Return true if this [errorCode] is likely to have a fix associated with it. bool hasFix(ErrorCode errorCode) => - errorCode == CompileTimeErrorCode.UNDEFINED_CLASS_BOOLEAN || + errorCode == CompileTimeErrorCode.CAST_TO_NON_TYPE || errorCode == CompileTimeErrorCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER || + errorCode == CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE || + errorCode == CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER || + errorCode == CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION || errorCode == CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR || errorCode == CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE || @@ -29,7 +32,7 @@ bool hasFix(ErrorCode errorCode) => errorCode == CompileTimeErrorCode .NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS || - errorCode == CompileTimeErrorCode.CAST_TO_NON_TYPE || + errorCode == CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT || errorCode == CompileTimeErrorCode.TYPE_TEST_WITH_UNDEFINED_NAME || errorCode == CompileTimeErrorCode.FINAL_NOT_INITIALIZED || errorCode == CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1 || @@ -44,8 +47,13 @@ bool hasFix(ErrorCode errorCode) => errorCode == CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT || errorCode == CompileTimeErrorCode.PART_OF_NON_PART || errorCode == CompileTimeErrorCode.UNDEFINED_ANNOTATION || + errorCode == CompileTimeErrorCode.UNDEFINED_CLASS_BOOLEAN || errorCode == CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT || + errorCode == CompileTimeErrorCode.UNDEFINED_FUNCTION || + errorCode == CompileTimeErrorCode.UNDEFINED_GETTER || + errorCode == CompileTimeErrorCode.UNDEFINED_METHOD || + errorCode == CompileTimeErrorCode.UNDEFINED_SETTER || errorCode == CompileTimeErrorCode.URI_DOES_NOT_EXIST || errorCode == CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED || errorCode == HintCode.CAN_BE_NULL_AFTER_NULL_AWARE || @@ -60,14 +68,6 @@ bool hasFix(ErrorCode errorCode) => errorCode == ParserErrorCode.EXPECTED_TOKEN || errorCode == ParserErrorCode.GETTER_WITH_PARAMETERS || errorCode == ParserErrorCode.VAR_AS_TYPE_NAME || - errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE || - errorCode == StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER || - errorCode == StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION || - errorCode == StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT || - errorCode == StaticTypeWarningCode.UNDEFINED_FUNCTION || - errorCode == StaticTypeWarningCode.UNDEFINED_GETTER || - errorCode == StaticTypeWarningCode.UNDEFINED_METHOD || - errorCode == StaticTypeWarningCode.UNDEFINED_SETTER || errorCode == CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER || (errorCode is LintCode && (errorCode.name == LintNames.always_require_non_null_named_parameters || diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart index 90f10f5d0c5..b971b294610 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart @@ -528,6 +528,9 @@ class FixProcessor extends BaseProcessor { CompileTimeErrorCode.NON_TYPE_IN_CATCH_CLAUSE: [ ImportLibrary.forType, ], + CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT: [ + ImportLibrary.forType, + ], CompileTimeErrorCode.NOT_A_TYPE: [ ImportLibrary.forType, ], @@ -544,12 +547,25 @@ class FixProcessor extends BaseProcessor { CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT: [ AddSuperConstructorInvocation.newInstance, ], + CompileTimeErrorCode.UNDEFINED_FUNCTION: [ + ImportLibrary.forExtension, + ImportLibrary.forFunction, + ImportLibrary.forType, + ], + CompileTimeErrorCode.UNDEFINED_GETTER: [ + ImportLibrary.forTopLevelVariable, + ImportLibrary.forType, + ], CompileTimeErrorCode.UNDEFINED_IDENTIFIER: [ ImportLibrary.forExtension, ImportLibrary.forFunction, ImportLibrary.forTopLevelVariable, ImportLibrary.forType, ], + CompileTimeErrorCode.UNDEFINED_METHOD: [ + ImportLibrary.forFunction, + ImportLibrary.forType, + ], CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER: [ ChangeArgumentName.newInstance, ], @@ -562,22 +578,6 @@ class FixProcessor extends BaseProcessor { HintCode.SDK_VERSION_ASYNC_EXPORTED_FROM_CORE: [ ImportLibrary.dartAsync, ], - StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT: [ - ImportLibrary.forType, - ], - StaticTypeWarningCode.UNDEFINED_FUNCTION: [ - ImportLibrary.forExtension, - ImportLibrary.forFunction, - ImportLibrary.forType, - ], - StaticTypeWarningCode.UNDEFINED_GETTER: [ - ImportLibrary.forTopLevelVariable, - ImportLibrary.forType, - ], - StaticTypeWarningCode.UNDEFINED_METHOD: [ - ImportLibrary.forFunction, - ImportLibrary.forType, - ], }; /// A map from error codes to a list of generators used to create the @@ -651,6 +651,9 @@ class FixProcessor extends BaseProcessor { CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS: [ AddFieldFormalParameters.newInstance, ], + CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE: [ + ReplaceReturnTypeFuture.newInstance, + ], CompileTimeErrorCode.IMPLEMENTS_NON_CLASS: [ ChangeTo.classOrMixin, CreateClass.newInstance, @@ -658,6 +661,9 @@ class FixProcessor extends BaseProcessor { CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD: [ CreateField.newInstance, ], + CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER: [ + ChangeToStaticAccess.newInstance, + ], CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE: [ ChangeToNearestPreciseValue.newInstance, ], @@ -665,6 +671,13 @@ class FixProcessor extends BaseProcessor { ChangeTo.annotation, CreateClass.newInstance, ], + CompileTimeErrorCode.INVALID_ASSIGNMENT: [ + AddExplicitCast.newInstance, + ChangeTypeAnnotation.newInstance, + ], + CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION: [ + RemoveParenthesesInGetterInvocation.newInstance, + ], CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER: [ AddRequiredKeyword.newInstance, ], @@ -707,6 +720,13 @@ class FixProcessor extends BaseProcessor { CreateNoSuchMethod.newInstance, MakeClassAbstract.newInstance, ], + CompileTimeErrorCode.NON_BOOL_CONDITION: [ + AddNeNull.newInstance, + ], + CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT: [ + CreateClass.newInstance, + CreateMixin.newInstance, + ], CompileTimeErrorCode.NOT_A_TYPE: [ ChangeTo.classOrMixin, CreateClass.newInstance, @@ -756,6 +776,20 @@ class FixProcessor extends BaseProcessor { ChangeTo.getterOrSetter, CreateSetter.newInstance, ], + CompileTimeErrorCode.UNDEFINED_FUNCTION: [ + ChangeTo.function, + CreateClass.newInstance, + CreateFunction.newInstance, + ], + CompileTimeErrorCode.UNDEFINED_GETTER: [ + ChangeTo.getterOrSetter, + CreateClass.newInstance, + CreateField.newInstance, + CreateGetter.newInstance, + CreateLocalVariable.newInstance, + CreateMethodOrFunction.newInstance, + CreateMixin.newInstance, + ], CompileTimeErrorCode.UNDEFINED_IDENTIFIER: [ ChangeTo.getterOrSetter, CreateClass.newInstance, @@ -769,11 +803,28 @@ class FixProcessor extends BaseProcessor { CompileTimeErrorCode.UNDEFINED_IDENTIFIER_AWAIT: [ AddAsync.newInstance, ], + CompileTimeErrorCode.UNDEFINED_METHOD: [ + ChangeTo.method, + CreateClass.newInstance, + CreateFunction.newInstance, + CreateMethod.method, + ], CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER: [ AddMissingParameterNamed.newInstance, ConvertFlutterChild.newInstance, ConvertFlutterChildren.newInstance, ], + CompileTimeErrorCode.UNDEFINED_SETTER: [ + ChangeTo.getterOrSetter, + CreateField.newInstance, + CreateSetter.newInstance, + ], + CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER: [ + // TODO(brianwilkerson) Consider adding fixes to create a field, getter, + // method or setter. The existing _addFix methods would need to be + // updated so that only the appropriate subset is generated. + QualifyReference.newInstance, + ], CompileTimeErrorCode .UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE: [ // TODO(brianwilkerson) Consider adding fixes to create a field, getter, @@ -784,6 +835,10 @@ class FixProcessor extends BaseProcessor { CompileTimeErrorCode.URI_DOES_NOT_EXIST: [ CreateFile.newInstance, ], + CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR: [ + MoveTypeArgumentsToClass.newInstance, + RemoveTypeArguments.newInstance, + ], HintCode.CAN_BE_NULL_AFTER_NULL_AWARE: [ ReplaceWithNullAware.newInstance, @@ -943,61 +998,6 @@ class FixProcessor extends BaseProcessor { ParserErrorCode.VAR_AS_TYPE_NAME: [ ReplaceVarWithDynamic.newInstance, ], - StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE: [ - ReplaceReturnTypeFuture.newInstance, - ], - StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER: [ - ChangeToStaticAccess.newInstance, - ], - StaticTypeWarningCode.INVALID_ASSIGNMENT: [ - AddExplicitCast.newInstance, - ChangeTypeAnnotation.newInstance, - ], - StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION: [ - RemoveParenthesesInGetterInvocation.newInstance, - ], - StaticTypeWarningCode.NON_BOOL_CONDITION: [ - AddNeNull.newInstance, - ], - StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT: [ - CreateClass.newInstance, - CreateMixin.newInstance, - ], - StaticTypeWarningCode.UNDEFINED_FUNCTION: [ - ChangeTo.function, - CreateClass.newInstance, - CreateFunction.newInstance, - ], - StaticTypeWarningCode.UNDEFINED_GETTER: [ - ChangeTo.getterOrSetter, - CreateClass.newInstance, - CreateField.newInstance, - CreateGetter.newInstance, - CreateLocalVariable.newInstance, - CreateMethodOrFunction.newInstance, - CreateMixin.newInstance, - ], - StaticTypeWarningCode.UNDEFINED_METHOD: [ - ChangeTo.method, - CreateClass.newInstance, - CreateFunction.newInstance, - CreateMethod.method, - ], - StaticTypeWarningCode.UNDEFINED_SETTER: [ - ChangeTo.getterOrSetter, - CreateField.newInstance, - CreateSetter.newInstance, - ], - StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR: [ - MoveTypeArgumentsToClass.newInstance, - RemoveTypeArguments.newInstance, - ], - StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER: [ - // TODO(brianwilkerson) Consider adding fixes to create a field, getter, - // method or setter. The existing _addFix methods would need to be - // updated so that only the appropriate subset is generated. - QualifyReference.newInstance, - ], StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION: [ RemoveDeadIfNull.newInstance, ], diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart index 51e813fffdf..59af0c157ff 100644 --- a/pkg/analysis_server/test/context_manager_test.dart +++ b/pkg/analysis_server/test/context_manager_test.dart @@ -1544,7 +1544,7 @@ abstract class ContextManagerTest with ResourceProviderMixin { ]); AnalysisError invalid_assignment_error = - AnalysisError(null, 0, 1, StaticTypeWarningCode.INVALID_ASSIGNMENT, [ + AnalysisError(null, 0, 1, CompileTimeErrorCode.INVALID_ASSIGNMENT, [ ['x'], ['y'] ]); diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_explicit_cast_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_explicit_cast_test.dart index 1f84c34f81a..cdcb95c7f5a 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_explicit_cast_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_explicit_cast_test.dart @@ -64,7 +64,7 @@ f(A a) { class A {} class B {} '''); - await assertHasFixAllFix(StaticTypeWarningCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' f(A a) { B b, b2; b = a as B; @@ -106,7 +106,7 @@ f(List a) { class A {} class B {} '''); - await assertHasFixAllFix(StaticTypeWarningCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' f(List a) { List b, b2; b = a.where((e) => e is B).cast().toList(); @@ -148,7 +148,7 @@ f(Map a) { class A {} class B {} '''); - await assertHasFixAllFix(StaticTypeWarningCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' f(Map a) { Map b, b2; b = a.cast(); @@ -196,7 +196,7 @@ class A { } class B {} '''); - await assertHasFixAllFix(StaticTypeWarningCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' f(A a) { B b, b2; b = (a..m()) as B; @@ -240,7 +240,7 @@ f(Set a) { class A {} class B {} '''); - await assertHasFixAllFix(StaticTypeWarningCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' f(Set a) { Set b, b2; b = a.cast(); @@ -291,7 +291,7 @@ f(A a) { class A {} class B {} '''); - await assertHasFixAllFix(StaticTypeWarningCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' f(A a) { B b = a as B; B b2 = a as B; @@ -329,7 +329,7 @@ f(List a) { class A {} class B {} '''); - await assertHasFixAllFix(StaticTypeWarningCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' f(List a) { List b = a.where((e) => e is B).cast().toList(); List b2 = a.where((e) => e is B).cast().toList(); @@ -367,7 +367,7 @@ f(Map a) { class A {} class B {} '''); - await assertHasFixAllFix(StaticTypeWarningCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' f(Map a) { Map b = a.cast(); Map b2 = a.cast(); @@ -411,7 +411,7 @@ class A { } class B {} '''); - await assertHasFixAllFix(StaticTypeWarningCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' f(A a) { B b = (a..m()) as B; B b2 = (a..m()) as B; @@ -451,7 +451,7 @@ f(Set a) { class A {} class B {} '''); - await assertHasFixAllFix(StaticTypeWarningCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' f(Set a) { Set b = a.cast(); Set b2 = a.cast(); @@ -469,7 +469,7 @@ void foo(int a) { '''); await assertNoFix( errorFilter: (e) { - return e.errorCode == StaticTypeWarningCode.INVALID_ASSIGNMENT; + return e.errorCode == CompileTimeErrorCode.INVALID_ASSIGNMENT; }, ); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_ne_null_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_ne_null_test.dart index a844e27ed5d..657adccdb16 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_ne_null_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_ne_null_test.dart @@ -48,7 +48,7 @@ main(String p, String q) { } } '''); - await assertHasFixAllFix(StaticTypeWarningCode.NON_BOOL_CONDITION, ''' + await assertHasFixAllFix(CompileTimeErrorCode.NON_BOOL_CONDITION, ''' main(String p, String q) { if (p != null) { print(p); diff --git a/pkg/analysis_server/test/src/services/correction/fix/change_type_annotation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/change_type_annotation_test.dart index b9f2735b4ff..91c23218bb9 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/change_type_annotation_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/change_type_annotation_test.dart @@ -78,7 +78,7 @@ int foo = '''); await assertNoFix( errorFilter: (e) { - return e.errorCode == StaticTypeWarningCode.INVALID_ASSIGNMENT; + return e.errorCode == CompileTimeErrorCode.INVALID_ASSIGNMENT; }, ); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_field_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_field_test.dart index eec3b63da26..df32308f20a 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/create_field_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/create_field_test.dart @@ -379,7 +379,7 @@ main(A a) { } '''); await assertNoFix(errorFilter: (e) { - return e.errorCode == StaticTypeWarningCode.UNDEFINED_GETTER; + return e.errorCode == CompileTimeErrorCode.UNDEFINED_GETTER; }); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_getter_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_getter_test.dart index b3e1fe2a96a..c8797e34508 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/create_getter_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/create_getter_test.dart @@ -322,7 +322,7 @@ main(A a) { } '''); await assertNoFix(errorFilter: (e) { - return e.errorCode == StaticTypeWarningCode.UNDEFINED_GETTER; + return e.errorCode == CompileTimeErrorCode.UNDEFINED_GETTER; }); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_setter_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_setter_test.dart index 5dc1260178b..1a984bf4e20 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/create_setter_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/create_setter_test.dart @@ -316,7 +316,7 @@ main(A a) { } '''); await assertNoFix(errorFilter: (e) { - return e.errorCode == StaticTypeWarningCode.UNDEFINED_SETTER; + return e.errorCode == CompileTimeErrorCode.UNDEFINED_SETTER; }); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_future_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_future_test.dart index aa333d539c5..e40a0b27f1d 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_future_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_future_test.dart @@ -29,7 +29,7 @@ var v;int main() async => 0; import 'dart:async'; var v;Future main() async => 0; ''', errorFilter: (error) { - return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE; + return error.errorCode == CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE; }); } @@ -53,7 +53,7 @@ import 'dart:async'; Future> main() async { } ''', errorFilter: (error) { - return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE; + return error.errorCode == CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE; }); } @@ -69,7 +69,7 @@ import 'dart:async'; Future> main() async { } ''', errorFilter: (error) { - return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE; + return error.errorCode == CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE; }); } @@ -84,7 +84,7 @@ import 'dart:async' as al; al.Future main() async { } ''', errorFilter: (error) { - return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE; + return error.errorCode == CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE; }); } @@ -97,7 +97,7 @@ int main() async => 0; import 'dart:async'; Future main() async => 0; ''', errorFilter: (error) { - return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE; + return error.errorCode == CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE; }); } @@ -111,7 +111,7 @@ import 'dart:async'; Future main() async => 0; ''', errorFilter: (error) { - return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE; + return error.errorCode == CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE; }); } @@ -128,7 +128,7 @@ import 'dart:async'; Future main() async { } ''', errorFilter: (error) { - return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE; + return error.errorCode == CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE; }); } diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart index e281f0d0814..c9eaa038c28 100644 --- a/pkg/analyzer/lib/error/error.dart +++ b/pkg/analyzer/lib/error/error.dart @@ -154,6 +154,9 @@ const List errorCodeValues = [ CompileTimeErrorCode.ENUM_CONSTANT_SAME_NAME_AS_ENCLOSING, CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS, + CompileTimeErrorCode.EXPECTED_ONE_SET_TYPE_ARGUMENTS, + CompileTimeErrorCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY, CompileTimeErrorCode.EXPORT_LEGACY_SYMBOL, CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, @@ -184,6 +187,8 @@ const List errorCodeValues = [ CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_2, CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS, + CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, + CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, CompileTimeErrorCode.FOR_IN_WITH_CONST_VARIABLE, CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND, CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT, @@ -191,6 +196,7 @@ const List errorCodeValues = [ CompileTimeErrorCode.GETTER_NOT_SUBTYPE_SETTER_TYPES, CompileTimeErrorCode.IF_ELEMENT_CONDITION_FROM_DEFERRED_LIBRARY, CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, + CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS, CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, @@ -208,6 +214,7 @@ const List errorCodeValues = [ CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD, + CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, @@ -217,6 +224,7 @@ const List errorCodeValues = [ CompileTimeErrorCode.INVALID_ANNOTATION, CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY, CompileTimeErrorCode.INVALID_ANNOTATION_GETTER, + CompileTimeErrorCode.INVALID_ASSIGNMENT, CompileTimeErrorCode.INVALID_CAST_FUNCTION, CompileTimeErrorCode.INVALID_CAST_FUNCTION_EXPR, CompileTimeErrorCode.INVALID_CAST_LITERAL, @@ -242,6 +250,8 @@ const List errorCodeValues = [ CompileTimeErrorCode.INVALID_USE_OF_COVARIANT, CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, CompileTimeErrorCode.INVOCATION_OF_EXTENSION_WITHOUT_CALL, + CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION, + CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE, CompileTimeErrorCode.LABEL_UNDEFINED, CompileTimeErrorCode.LATE_FINAL_FIELD_WITH_CONST_CONSTRUCTOR, @@ -288,6 +298,10 @@ const List errorCodeValues = [ CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE, CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO, + CompileTimeErrorCode.NON_BOOL_CONDITION, + CompileTimeErrorCode.NON_BOOL_EXPRESSION, + CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, + CompileTimeErrorCode.NON_BOOL_OPERAND, CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT, CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR, CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION, @@ -304,6 +318,7 @@ const List errorCodeValues = [ CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, CompileTimeErrorCode.NON_SYNC_FACTORY, + CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, CompileTimeErrorCode.NON_TYPE_IN_CATCH_CLAUSE, CompileTimeErrorCode.NON_VOID_RETURN_FOR_OPERATOR, CompileTimeErrorCode.NON_VOID_RETURN_FOR_SETTER, @@ -353,6 +368,10 @@ const List errorCodeValues = [ CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH, CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, CompileTimeErrorCode.RETURN_IN_GENERATOR, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, CompileTimeErrorCode.RETURN_WITHOUT_VALUE, CompileTimeErrorCode.SET_ELEMENT_FROM_DEFERRED_LIBRARY, CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, @@ -371,6 +390,7 @@ const List errorCodeValues = [ CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, + CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, CompileTimeErrorCode.TYPE_TEST_WITH_NON_TYPE, CompileTimeErrorCode.TYPE_TEST_WITH_UNDEFINED_NAME, CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE, @@ -379,13 +399,25 @@ const List errorCodeValues = [ CompileTimeErrorCode.UNDEFINED_CLASS_BOOLEAN, CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, + CompileTimeErrorCode.UNDEFINED_ENUM_CONSTANT, CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER, CompileTimeErrorCode.UNDEFINED_EXTENSION_METHOD, CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, + CompileTimeErrorCode.UNDEFINED_FUNCTION, + CompileTimeErrorCode.UNDEFINED_GETTER, CompileTimeErrorCode.UNDEFINED_IDENTIFIER, CompileTimeErrorCode.UNDEFINED_IDENTIFIER_AWAIT, + CompileTimeErrorCode.UNDEFINED_METHOD, CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER, + CompileTimeErrorCode.UNDEFINED_OPERATOR, + CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, + CompileTimeErrorCode.UNDEFINED_SETTER, + CompileTimeErrorCode.UNDEFINED_SUPER_GETTER, + CompileTimeErrorCode.UNDEFINED_SUPER_METHOD, + CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, + CompileTimeErrorCode.UNDEFINED_SUPER_SETTER, + CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE, CompileTimeErrorCode.URI_DOES_NOT_EXIST, CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED, @@ -395,10 +427,14 @@ const List errorCodeValues = [ CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, + CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, + CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_POSITION, CompileTimeErrorCode.YIELD_EACH_IN_NON_GENERATOR, CompileTimeErrorCode.YIELD_IN_NON_GENERATOR, + CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, FfiCode.ANNOTATION_ON_POINTER_FIELD, FfiCode.EXTRA_ANNOTATION_ON_STRUCT_FIELD, FfiCode.FIELD_IN_STRUCT_WITH_INITIALIZER, @@ -748,42 +784,6 @@ const List errorCodeValues = [ ScannerErrorCode.UNSUPPORTED_OPERATOR, ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT, ScannerErrorCode.UNTERMINATED_STRING_LITERAL, - StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS, - StaticTypeWarningCode.EXPECTED_ONE_SET_TYPE_ARGUMENTS, - StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, - StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, - StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE, - StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE, - StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, - StaticTypeWarningCode.INVALID_ASSIGNMENT, - StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, - StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - StaticTypeWarningCode.NON_BOOL_CONDITION, - StaticTypeWarningCode.NON_BOOL_EXPRESSION, - StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION, - StaticTypeWarningCode.NON_BOOL_OPERAND, - StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT, - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, - StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - StaticTypeWarningCode.UNDEFINED_ENUM_CONSTANT, - StaticTypeWarningCode.UNDEFINED_FUNCTION, - StaticTypeWarningCode.UNDEFINED_GETTER, - StaticTypeWarningCode.UNDEFINED_METHOD, - StaticTypeWarningCode.UNDEFINED_OPERATOR, - StaticTypeWarningCode.UNDEFINED_PREFIXED_NAME, - StaticTypeWarningCode.UNDEFINED_SETTER, - StaticTypeWarningCode.UNDEFINED_SUPER_GETTER, - StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, - StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, - StaticTypeWarningCode.UNDEFINED_SUPER_SETTER, - StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, - StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, - StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, - StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, - StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, StaticWarningCode.INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT, diff --git a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart index b60196aa399..ea7d03be33b 100644 --- a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart +++ b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart @@ -442,8 +442,8 @@ class LibraryAnalyzer { // non-internal code from importing internal code. bool privileged = false; - if (code == StaticTypeWarningCode.UNDEFINED_FUNCTION || - code == StaticTypeWarningCode.UNDEFINED_PREFIXED_NAME) { + if (code == CompileTimeErrorCode.UNDEFINED_FUNCTION || + code == CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME) { // Special case a small number of errors in Flutter code which are // ignored. The erroneous code is found in a conditionally imported // library, which uses a special version of the "dart:ui" library diff --git a/pkg/analyzer/lib/src/dart/constant/evaluation.dart b/pkg/analyzer/lib/src/dart/constant/evaluation.dart index 2509b5fbc8e..aae5beab037 100644 --- a/pkg/analyzer/lib/src/dart/constant/evaluation.dart +++ b/pkg/analyzer/lib/src/dart/constant/evaluation.dart @@ -229,7 +229,7 @@ class ConstantEvaluationEngine { if (dartObject != null && constant.isConst) { if (!runtimeTypeMatch(dartObject, constant.type)) { // TODO(brianwilkerson) This should not be reported if - // StaticTypeWarningCode.INVALID_ASSIGNMENT has already been + // CompileTimeErrorCode.INVALID_ASSIGNMENT has already been // reported (that is, if the static types are also wrong). errorReporter.reportErrorForNode( CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH, diff --git a/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart index 165da4320ec..e558b4d2b6a 100644 --- a/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart @@ -223,7 +223,7 @@ class AssignmentExpressionResolver { node.staticElement = result.getter; if (_shouldReportInvalidMember(staticType, result)) { _errorReporter.reportErrorForToken( - StaticTypeWarningCode.UNDEFINED_OPERATOR, + CompileTimeErrorCode.UNDEFINED_OPERATOR, operator, [methodName, staticType], ); @@ -281,7 +281,7 @@ class AssignmentExpressionResolver { var leftWriteType = _getStaticType2(node.leftHandSide); if (!_typeSystem.isAssignableTo2(type, leftWriteType)) { _resolver.errorReporter.reportErrorForNode( - StaticTypeWarningCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.INVALID_ASSIGNMENT, node.rightHandSide, [type, leftWriteType], ); diff --git a/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart b/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart index aeff38bf3a9..b4bb472cd49 100644 --- a/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart +++ b/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart @@ -65,7 +65,7 @@ class AstRewriter { var typeArguments = node.typeArguments; if (typeArguments != null) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode + CompileTimeErrorCode .WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, typeArguments, [element.name, constructorElement.name]); @@ -122,7 +122,7 @@ class AstRewriter { var typeArguments = node.typeArguments; if (typeArguments != null) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode + CompileTimeErrorCode .WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, typeArguments, [element.name, constructorElement.name]); diff --git a/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart index 818e4c5d0c8..8486729d887 100644 --- a/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart @@ -102,7 +102,7 @@ class BinaryExpressionResolver { void _checkNonBoolOperand(Expression operand, String operator) { _resolver.boolExpressionVerifier.checkForNonBoolExpression( operand, - errorCode: StaticTypeWarningCode.NON_BOOL_OPERAND, + errorCode: CompileTimeErrorCode.NON_BOOL_OPERAND, arguments: [operator], ); } @@ -335,13 +335,13 @@ class BinaryExpressionResolver { if (_shouldReportInvalidMember(leftType, result)) { if (leftOperand is SuperExpression) { _errorReporter.reportErrorForToken( - StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, + CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, node.operator, [methodName, leftType], ); } else { _errorReporter.reportErrorForToken( - StaticTypeWarningCode.UNDEFINED_OPERATOR, + CompileTimeErrorCode.UNDEFINED_OPERATOR, node.operator, [methodName, leftType], ); diff --git a/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart b/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart index cc18f5e892a..d6f416cbde3 100644 --- a/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart +++ b/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart @@ -406,7 +406,7 @@ class InvocationInferenceHelper { List typeArguments; if (typeArgumentList.arguments.length != typeParameters.length) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, + CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, typeArgumentList, [ rawType, diff --git a/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart index ceb24d4f9f0..3aa84e82003 100644 --- a/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart @@ -190,13 +190,13 @@ class MethodInvocationResolver { ); } else if (nullReceiver) { _resolver.errorReporter.reportErrorForNode( - StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, + CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, nameNode, [element.enclosingElement.displayName], ); } else { _resolver.errorReporter.reportErrorForNode( - StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, nameNode, [ nameNode.name, @@ -210,7 +210,7 @@ class MethodInvocationResolver { void _reportInvocationOfNonFunction(MethodInvocation node) { _setDynamicResolution(node, setNameTypeToDynamic: false); _resolver.errorReporter.reportErrorForNode( - StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, + CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION, node.methodName, [node.methodName.name], ); @@ -245,7 +245,7 @@ class MethodInvocationResolver { } _resolver.errorReporter.reportErrorForNode( - StaticTypeWarningCode.UNDEFINED_FUNCTION, + CompileTimeErrorCode.UNDEFINED_FUNCTION, node.methodName, [node.methodName.name], ); @@ -255,7 +255,7 @@ class MethodInvocationResolver { MethodInvocation node, String name, ClassElement typeReference) { _setDynamicResolution(node); _resolver.errorReporter.reportErrorForNode( - StaticTypeWarningCode.UNDEFINED_METHOD, + CompileTimeErrorCode.UNDEFINED_METHOD, node.methodName, [name, typeReference.displayName], ); @@ -609,7 +609,7 @@ class MethodInvocationResolver { // Nothing help, there is no target at all. _setDynamicResolution(node); _resolver.errorReporter.reportErrorForNode( - StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, + CompileTimeErrorCode.UNDEFINED_SUPER_METHOD, nameNode, [name, enclosingClass.displayName]); } @@ -664,7 +664,7 @@ class MethodInvocationResolver { if (!nameNode.isSynthetic) { _resolver.errorReporter.reportErrorForNode( - StaticTypeWarningCode.UNDEFINED_METHOD, + CompileTimeErrorCode.UNDEFINED_METHOD, nameNode, [name, receiverClassName], ); diff --git a/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart index 43b20e78920..e3f3cc0b092 100644 --- a/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart @@ -73,7 +73,7 @@ class PostfixExpressionResolver { var operandWriteType = _getWriteType(operand); if (!_typeSystem.isAssignableTo2(type, operandWriteType)) { _resolver.errorReporter.reportErrorForNode( - StaticTypeWarningCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.INVALID_ASSIGNMENT, node, [type, operandWriteType], ); @@ -149,13 +149,13 @@ class PostfixExpressionResolver { if (_shouldReportInvalidMember(receiverType, result)) { if (operand is SuperExpression) { _errorReporter.reportErrorForToken( - StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, + CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, node.operator, [methodName, receiverType], ); } else { _errorReporter.reportErrorForToken( - StaticTypeWarningCode.UNDEFINED_OPERATOR, + CompileTimeErrorCode.UNDEFINED_OPERATOR, node.operator, [methodName, receiverType], ); diff --git a/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart index beeb19aa74f..8a273347ec1 100644 --- a/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart @@ -73,7 +73,7 @@ class PrefixExpressionResolver { var operandWriteType = _getStaticType(operand); if (!_typeSystem.isAssignableTo2(type, operandWriteType)) { _resolver.errorReporter.reportErrorForNode( - StaticTypeWarningCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.INVALID_ASSIGNMENT, node, [type, operandWriteType], ); @@ -205,13 +205,13 @@ class PrefixExpressionResolver { if (_shouldReportInvalidMember(staticType, result)) { if (operand is SuperExpression) { _errorReporter.reportErrorForToken( - StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, + CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, operator, [methodName, staticType], ); } else { _errorReporter.reportErrorForToken( - StaticTypeWarningCode.UNDEFINED_OPERATOR, + CompileTimeErrorCode.UNDEFINED_OPERATOR, operator, [methodName, staticType], ); diff --git a/pkg/analyzer/lib/src/dart/resolver/type_name_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/type_name_resolver.dart index b6a88efff90..6fb94d6fc42 100644 --- a/pkg/analyzer/lib/src/dart/resolver/type_name_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/type_name_resolver.dart @@ -122,7 +122,7 @@ class TypeNameResolver { if (argumentCount != parameterCount) { errorReporter.reportErrorForNode( - StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, + CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, node, [node.name.name, parameterCount, argumentCount], ); @@ -333,7 +333,7 @@ class TypeNameResolver { var typeArguments = node.typeArguments; if (typeArguments != null) { errorReporter.reportErrorForNode( - StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, typeArguments, [classIdentifier.name, constructorIdentifier.name], ); @@ -454,7 +454,7 @@ class _ErrorHelper { if (_isTypeInTypeArgumentList(node)) { errorReporter.reportErrorForNode( - StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT, + CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, identifier, [identifier.name], ); diff --git a/pkg/analyzer/lib/src/dart/resolver/yield_statement_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/yield_statement_resolver.dart index f12a3d24f9a..e79edc9f7e3 100644 --- a/pkg/analyzer/lib/src/dart/resolver/yield_statement_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/yield_statement_resolver.dart @@ -87,7 +87,7 @@ class YieldStatementResolver { if (declaredReturnType != null) { if (!_typeSystem.isAssignableTo2(impliedReturnType, declaredReturnType)) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, + CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, expression, [impliedReturnType, declaredReturnType], ); @@ -108,7 +108,7 @@ class YieldStatementResolver { if (!_typeSystem.isAssignableTo2(impliedReturnType, requiredReturnType)) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, + CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, expression, [impliedReturnType, requiredReturnType], ); diff --git a/pkg/analyzer/lib/src/error/bool_expression_verifier.dart b/pkg/analyzer/lib/src/error/bool_expression_verifier.dart index cf46b927a08..05eb039b6cb 100644 --- a/pkg/analyzer/lib/src/error/bool_expression_verifier.dart +++ b/pkg/analyzer/lib/src/error/bool_expression_verifier.dart @@ -35,11 +35,11 @@ class BoolExpressionVerifier { /// Check to ensure that the [condition] is of type bool, are. Otherwise an /// error is reported on the expression. /// - /// See [StaticTypeWarningCode.NON_BOOL_CONDITION]. + /// See [CompileTimeErrorCode.NON_BOOL_CONDITION]. void checkForNonBoolCondition(Expression condition) { checkForNonBoolExpression( condition, - errorCode: StaticTypeWarningCode.NON_BOOL_CONDITION, + errorCode: CompileTimeErrorCode.NON_BOOL_CONDITION, ); } @@ -62,7 +62,7 @@ class BoolExpressionVerifier { void checkForNonBoolNegationExpression(Expression expression) { checkForNonBoolExpression( expression, - errorCode: StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION, + errorCode: CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, ); } diff --git a/pkg/analyzer/lib/src/error/codes.dart b/pkg/analyzer/lib/src/error/codes.dart index bc933063877..4a2f9c41a4e 100644 --- a/pkg/analyzer/lib/src/error/codes.dart +++ b/pkg/analyzer/lib/src/error/codes.dart @@ -2500,6 +2500,45 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { correction: "Change or remove the duplicate key.", hasPublishedDocs: true); + /** + * 12.7 Lists: A fresh instance (7.6.1) a, of size n, whose + * class implements the built-in class List<E> is allocated. + * + * Parameters: + * 0: the number of provided type arguments + */ + static const CompileTimeErrorCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = + CompileTimeErrorCode( + 'EXPECTED_ONE_LIST_TYPE_ARGUMENTS', + "List literals require exactly one type argument or none, " + "but {0} found.", + correction: "Try adjusting the number of type arguments."); + + /** + * Parameters: + * 0: the number of provided type arguments + */ + static const CompileTimeErrorCode EXPECTED_ONE_SET_TYPE_ARGUMENTS = + CompileTimeErrorCode( + 'EXPECTED_ONE_SET_TYPE_ARGUMENTS', + "Set literals require exactly one type argument or none, " + "but {0} found.", + correction: "Try adjusting the number of type arguments."); + + /** + * 12.8 Maps: A fresh instance (7.6.1) m, of size n, whose class + * implements the built-in class Map<K, V> is allocated. + * + * Parameters: + * 0: the number of provided type arguments + */ + static const CompileTimeErrorCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = + CompileTimeErrorCode( + 'EXPECTED_TWO_MAP_TYPE_ARGUMENTS', + "Map literals require exactly two type arguments or none, " + "but {0} found.", + correction: "Try adjusting the number of type arguments."); + /** * SDK implementation libraries can be exported only by other SDK libraries. * @@ -3487,6 +3526,61 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { correction: "Try adding initializers for the fields.", hasPublishedDocs: true); + /** + * 17.6.2 For-in. It the iterable expression does not implement Iterable with + * a type argument that can be assigned to the for-in variable's type, this + * warning is reported. + * + * Parameters: + * 0: The type of the iterable expression. + * 1: The sequence type -- Iterable for `for` or Stream for `await for`. + * 2: The loop variable type. + */ + static const CompileTimeErrorCode FOR_IN_OF_INVALID_ELEMENT_TYPE = + CompileTimeErrorCode( + 'FOR_IN_OF_INVALID_ELEMENT_TYPE', + "The type '{0}' used in the 'for' loop must implement {1} with a " + "type argument that can be assigned to '{2}'."); + + /** + * Parameters: + * 0: The type of the iterable expression. + * 1: The sequence type -- Iterable for `for` or Stream for `await for`. + */ + // #### Description + // + // The analyzer produces this diagnostic when the expression following `in` in + // a for-in loop has a type that isn't a subclass of `Iterable`. + // + // #### Examples + // + // The following code produces this diagnostic because `m` is a `Map`, and + // `Map` isn't a subclass of `Iterable`: + // + // ```dart + // void f(Map m) { + // for (String s in [!m!]) { + // print(s); + // } + // } + // ``` + // + // #### Common fixes + // + // Replace the expression with one that produces an iterable value: + // + // ```dart + // void f(Map m) { + // for (String s in m.values) { + // print(s); + // } + // } + // ``` + static const CompileTimeErrorCode FOR_IN_OF_INVALID_TYPE = + CompileTimeErrorCode('FOR_IN_OF_INVALID_TYPE', + "The type '{0}' used in the 'for' loop must implement {1}.", + hasPublishedDocs: true); + static const CompileTimeErrorCode FOR_IN_WITH_CONST_VARIABLE = CompileTimeErrorCode('FOR_IN_WITH_CONST_VARIABLE', "A for-in loop-variable can't be 'const'.", @@ -3572,6 +3666,54 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { correction: "Try fixing the return type of the function, or " "removing the modifier 'async*' from the function body."); + /** + * No parameters. + */ + // #### Description + // + // The analyzer produces this diagnostic when the body of a function has the + // `async` modifier even though the return type of the function isn't + // assignable to `Future`. + // + // #### Example + // + // The following code produces this diagnostic because the body of the + // function `f` has the `async` modifier even though the return type isn't + // assignable to `Future`: + // + // ```dart + // [!int!] f() async { + // return 0; + // } + // ``` + // + // #### Common fixes + // + // If the function should be asynchronous, then change the return type to be + // assignable to `Future`: + // + // ```dart + // Future f() async { + // return 0; + // } + // ``` + // + // If the function should be synchronous, then remove the `async` modifier: + // + // ```dart + // int f() { + // return 0; + // } + // ``` + static const CompileTimeErrorCode ILLEGAL_ASYNC_RETURN_TYPE = + CompileTimeErrorCode( + 'ILLEGAL_ASYNC_RETURN_TYPE', + "Functions marked 'async' must have a return type assignable to " + "'Future'.", + correction: "Try fixing the return type of the function, or " + "removing the modifier 'async' from the function body.", + hasPublishedDocs: true); + /** * It is a compile-time error if the declared return type of a function marked * 'sync*' is not a supertype of 'Iterable' for some type 'T'. @@ -4065,6 +4207,51 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { "in a constructor can't be static.", correction: "Try removing the initialization."); + /** + * Parameters: + * 0: the name of the static member + * 1: the kind of the static member (field, getter, setter, or method) + * 2: the name of the defining class + */ + // #### Description + // + // The analyzer produces this diagnostic when an access operator is used to + // access a static member through an instance of the class. + // + // #### Examples + // + // The following code produces this diagnostic because `zero` is a static + // field, but it’s being accessed as if it were an instance field: + // + // ```dart + // void f(C c) { + // c.[!zero!]; + // } + // + // class C { + // static int zero = 0; + // } + // ``` + // + // #### Common fixes + // + // Use the class to access the static member: + // + // ```dart + // void f(C c) { + // C.zero; + // } + // + // class C { + // static int zero = 0; + // } + // ``` + static const CompileTimeErrorCode INSTANCE_ACCESS_TO_STATIC_MEMBER = + CompileTimeErrorCode('INSTANCE_ACCESS_TO_STATIC_MEMBER', + "Static {1} '{0}' can't be accessed through an instance.", + correction: "Try using the class '{2}' to access the {1}.", + hasPublishedDocs: true); + /** * No parameters. */ @@ -4271,6 +4458,56 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { 'INVALID_ANNOTATION_GETTER', "Getters can't be used as annotations.", correction: "Try using a top-level variable or a field."); + /** + * Parameters: + * 0: the name of the right hand side type + * 1: the name of the left hand side type + */ + // #### Description + // + // The analyzer produces this diagnostic when the static type of an expression + // that is assigned to a variable isn't assignable to the type of the + // variable. + // + // #### Examples + // + // The following code produces this diagnostic because the type of the + // initializer (`int`) isn't assignable to the type of the variable + // (`String`): + // + // ```dart + // int i = 0; + // String s = [!i!]; + // ``` + // + // #### Common fixes + // + // If the value being assigned is always assignable at runtime, even though + // the static types don't reflect that, then add an explicit cast. + // + // Otherwise, change the value being assigned so that it has the expected + // type. In the previous example, this might look like: + // + // ```dart + // int i = 0; + // String s = i.toString(); + // ``` + // + // If you can’t change the value, then change the type of the variable to be + // compatible with the type of the value being assigned: + // + // ```dart + // int i = 0; + // int s = i; + // ``` + static const CompileTimeErrorCode INVALID_ASSIGNMENT = CompileTimeErrorCode( + 'INVALID_ASSIGNMENT', + "A value of type '{0}' can't be assigned to a variable of type " + "'{1}'.", + correction: "Try changing the type of the variable, or " + "casting the right-hand type to '{1}'.", + hasPublishedDocs: true); + /** * Parameters: * 0: the type of the function @@ -4792,6 +5029,94 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { "can't be used in an invocation.", hasPublishedDocs: true); + /** + * Parameters: + * 0: the name of the identifier that is not a function type + */ + // #### Description + // + // The analyzer produces this diagnostic when it finds a function invocation, + // but the name of the function being invoked is defined to be something other + // than a function. + // + // #### Examples + // + // The following code produces this diagnostic because `Binary` is the name of + // a function type, not a function: + // + // ```dart + // typedef Binary = int Function(int, int); + // + // int f() { + // return [!Binary!](1, 2); + // } + // ``` + // + // #### Common fixes + // + // Replace the name with the name of a function. + static const CompileTimeErrorCode INVOCATION_OF_NON_FUNCTION = + CompileTimeErrorCode( + 'INVOCATION_OF_NON_FUNCTION', "'{0}' isn't a function.", + // TODO(brianwilkerson) Split this error code so that we can provide + // better error and correction messages. + correction: + "Try correcting the name to match an existing function, or " + "define a method or function named '{0}'.", + hasPublishedDocs: true); + + /** + * No parameters. + */ + // #### Description + // + // The analyzer produces this diagnostic when a function invocation is found, + // but the name being referenced isn't the name of a function, or when the + // expression computing the function doesn't compute a function. + // + // #### Examples + // + // The following code produces this diagnostic because `x` isn't a function: + // + // ```dart + // int x = 0; + // + // int f() => x; + // + // var y = [!x!](); + // ``` + // + // The following code produces this diagnostic because `f()` doesn't return a + // function: + // + // ```dart + // int x = 0; + // + // int f() => x; + // + // var y = [!f()!](); + // ``` + // + // #### Common fixes + // + // If you need to invoke a function, then replace the code before the argument + // list with the name of a function or with an expression that computes a + // function: + // + // ```dart + // int x = 0; + // + // int f() => x; + // + // var y = f(); + // ``` + static const CompileTimeErrorCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = + CompileTimeErrorCode( + 'INVOCATION_OF_NON_FUNCTION_EXPRESSION', + "The expression doesn't evaluate to a function, so it can't be " + "invoked.", + hasPublishedDocs: true); + /** * 13.13 Break: It is a compile-time error if no such statement * sE exists within the innermost function in which @@ -5734,6 +6059,140 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { "abstract.", hasPublishedDocs: true); + /** + * No parameters. + */ + // #### Description + // + // The analyzer produces this diagnostic when a condition, such as an `if` or + // `while` loop, doesn't have the static type `bool`. + // + // #### Examples + // + // The following code produces this diagnostic because `x` has the static type + // `int`: + // + // ```dart + // void f(int x) { + // if ([!x!]) { + // // ... + // } + // } + // ``` + // + // #### Common fixes + // + // Change the condition so that it produces a Boolean value: + // + // ```dart + // void f(int x) { + // if (x == 0) { + // // ... + // } + // } + // ``` + static const CompileTimeErrorCode NON_BOOL_CONDITION = CompileTimeErrorCode( + 'NON_BOOL_CONDITION', "Conditions must have a static type of 'bool'.", + correction: "Try changing the condition.", hasPublishedDocs: true); + + /** + * No parameters. + */ + // #### Description + // + // The analyzer produces this diagnostic when the first expression in an + // assert has a type other than `bool`. + // + // #### Examples + // + // The following code produces this diagnostic because the type of `p` is + // `int`, but a `bool` is required: + // + // ```dart + // void f(int p) { + // assert([!p!]); + // } + // ``` + // + // #### Common fixes + // + // Change the expression so that it has the type `bool`: + // + // ```dart + // void f(int p) { + // assert(p > 0); + // } + // ``` + static const CompileTimeErrorCode NON_BOOL_EXPRESSION = CompileTimeErrorCode( + 'NON_BOOL_EXPRESSION', + "The expression in an assert must be of type 'bool'.", + correction: "Try changing the expression.", + hasPublishedDocs: true); + + /** + * No parameters. + */ + // #### Description + // + // The analyzer produces this diagnostic when the operand of the unary + // negation operator (`!`) doesn't have the type `bool`. + // + // #### Examples + // + // The following code produces this diagnostic because `x` is an `int` when it + // must be a `bool`: + // + // ```dart + // int x = 0; + // bool y = ![!x!]; + // ``` + // + // #### Common fixes + // + // Replace the operand with an expression that has the type `bool`: + // + // ```dart + // int x = 0; + // bool y = !(x > 0); + // ``` + static const CompileTimeErrorCode NON_BOOL_NEGATION_EXPRESSION = + CompileTimeErrorCode('NON_BOOL_NEGATION_EXPRESSION', + "A negation operand must have a static type of 'bool'.", + correction: "Try changing the operand to the '!' operator.", + hasPublishedDocs: true); + + /** + * Parameters: + * 0: the lexeme of the logical operator + */ + // #### Description + // + // The analyzer produces this diagnostic when one of the operands of either + // the `&&` or `||` operator doesn't have the type `bool`. + // + // #### Examples + // + // The following code produces this diagnostic because `a` isn't a Boolean + // value: + // + // ```dart + // int a = 3; + // bool b = [!a!] || a > 1; + // ``` + // + // #### Common fixes + // + // Change the operand to a Boolean value: + // + // ```dart + // int a = 3; + // bool b = a == 0 || a > 1; + // ``` + static const CompileTimeErrorCode NON_BOOL_OPERAND = CompileTimeErrorCode( + 'NON_BOOL_OPERAND', + "The operands of the operator '{0}' must be assignable to 'bool'.", + hasPublishedDocs: true); + /** * 13.2 Expression Statements: It is a compile-time error if a non-constant * map literal that has no explicit type arguments appears in a place where a @@ -6189,6 +6648,41 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { 'NON_SYNC_FACTORY', "Factory bodies can't use 'async', 'async*', or 'sync*'."); + /** + * Parameters: + * 0: the name appearing where a type is expected + */ + // #### Description + // + // The analyzer produces this diagnostic when an identifier that isn't a type + // is used as a type argument. + // + // #### Examples + // + // The following code produces this diagnostic because `x` is a variable, not + // a type: + // + // ```dart + // var x = 0; + // List<[!x!]> xList = []; + // ``` + // + // #### Common fixes + // + // Change the type argument to be a type: + // + // ```dart + // var x = 0; + // List xList = []; + // ``` + static const CompileTimeErrorCode NON_TYPE_AS_TYPE_ARGUMENT = + CompileTimeErrorCode('NON_TYPE_AS_TYPE_ARGUMENT', + "The name '{0}' isn't a type so it can't be used as a type argument.", + correction: "Try correcting the name to an existing type, or " + "defining a type named '{0}'.", + hasPublishedDocs: true, + isUnresolvedIdentifier: true); + /** * Parameters: * 0: the name of the non-type element @@ -7593,6 +8087,112 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { correction: "Try removing the value, replacing 'return' with 'yield' or " "changing the method body modifier."); + /** + * Parameters: + * 0: the return type as declared in the return statement + * 1: the expected return type as defined by the method + */ + // #### Description + // + // The analyzer produces this diagnostic when the static type of a returned + // expression isn't assignable to the return type that the closure is required + // to have. + // + // #### Examples + // + // The following code produces this diagnostic because `f` is defined to be a + // function that returns a `String`, but the closure assigned to it returns an + // `int`: + // + // ```dart + // String Function(String) f = (s) => [!3!]; + // ``` + // + // #### Common fixes + // + // If the return type is correct, then replace the returned value with a value + // of the correct type, possibly by converting the existing value: + // + // ```dart + // String Function(String) f = (s) => 3.toString(); + // ``` + static const CompileTimeErrorCode RETURN_OF_INVALID_TYPE_FROM_CLOSURE = + CompileTimeErrorCode( + 'RETURN_OF_INVALID_TYPE_FROM_CLOSURE', + "The return type '{0}' isn't a '{1}', as required by the closure's " + "context.", + hasPublishedDocs: true); + + /** + * Parameters: + * 0: the return type as declared in the return statement + * 1: the expected return type as defined by the enclosing class + * 2: the name of the constructor + */ + static const CompileTimeErrorCode RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR = + CompileTimeErrorCodeWithUniqueName( + 'RETURN_OF_INVALID_TYPE', + 'CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR', + "A value of type '{0}' can't be returned from constructor '{2}' " + "because it has a return type of '{1}'.", + hasPublishedDocs: true); + + /** + * Parameters: + * 0: the return type as declared in the return statement + * 1: the expected return type as defined by the method + * 2: the name of the method + */ + // #### Description + // + // The analyzer produces this diagnostic when a method or function returns a + // value whose type isn't assignable to the declared return type. + // + // #### Examples + // + // The following code produces this diagnostic because `f` has a return type + // of `String` but is returning an `int`: + // + // ```dart + // String f() => [!3!]; + // ``` + // + // #### Common fixes + // + // If the return type is correct, then replace the value being returned with a + // value of the correct type, possibly by converting the existing value: + // + // ```dart + // String f() => 3.toString(); + // ``` + // + // If the value is correct, then change the return type to match: + // + // ```dart + // int f() => 3; + // ``` + static const CompileTimeErrorCode RETURN_OF_INVALID_TYPE_FROM_FUNCTION = + CompileTimeErrorCodeWithUniqueName( + 'RETURN_OF_INVALID_TYPE', + 'CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION', + "A value of type '{0}' can't be returned from function '{2}' because " + "it has a return type of '{1}'.", + hasPublishedDocs: true); + + /** + * Parameters: + * 0: the return type as declared in the return statement + * 1: the expected return type as defined by the method + * 2: the name of the method + */ + static const CompileTimeErrorCode RETURN_OF_INVALID_TYPE_FROM_METHOD = + CompileTimeErrorCodeWithUniqueName( + 'RETURN_OF_INVALID_TYPE', + 'CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD', + "A value of type '{0}' can't be returned from method '{2}' because " + "it has a return type of '{1}'.", + hasPublishedDocs: true); + /** * No parameters. */ @@ -7991,6 +8591,21 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { correction: "Try removing the reference to the type parameter, or " "making the member an instance member."); + /** + * 10 Generics: It is a static type warning if a type parameter is a supertype + * of its upper bound. + * + * Parameters: + * 0: the name of the type parameter + * 1: the name of the bounding type + * + * See [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]. + */ + static const CompileTimeErrorCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = + CompileTimeErrorCode('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', + "'{0}' can't be a supertype of its upper bound.", + correction: "Try using a type that is or is a subclass of '{1}'."); + /** * 12.31 Type Test: It is a static warning if T does not denote a type * available in the current lexical scope. @@ -8293,6 +8908,55 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { correction: "Try defining an unnamed constructor in '{0}', or " "invoking a different constructor."); + /** + * Parameters: + * 0: the name of the enumeration constant that is not defined + * 1: the name of the enumeration used to access the constant + */ + // #### Description + // + // The analyzer produces this diagnostic when it encounters an identifier that + // appears to be the name of an enum constant, and the name either isn't + // defined or isn't visible in the scope in which it's being referenced. + // + // #### Examples + // + // The following code produces this diagnostic because `E` doesn't define a + // constant named `c`: + // + // ```dart + // enum E {a, b} + // + // var e = E.[!c!]; + // ``` + // + // #### Common fixes + // + // If the constant should be defined, then add it to the declaration of the + // enum: + // + // ```dart + // enum E {a, b, c} + // + // var e = E.c; + // ``` + // + // If the constant shouldn't be defined, then change the name to the name of + // an existing constant: + // + // ```dart + // enum E {a, b} + // + // var e = E.b; + // ``` + static const CompileTimeErrorCode UNDEFINED_ENUM_CONSTANT = + CompileTimeErrorCode('UNDEFINED_ENUM_CONSTANT', + "There's no constant named '{0}' in '{1}'.", + correction: + "Try correcting the name to the name of an existing constant, or " + "defining a constant named '{0}'.", + hasPublishedDocs: true); + /** * Parameters: * 0: the name of the getter that is undefined @@ -8608,6 +9272,89 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { "defining a setter named '{0}'.", hasPublishedDocs: true); + /** + * Parameters: + * 0: the name of the method that is undefined + */ + // #### Description + // + // The analyzer produces this diagnostic when it encounters an identifier that + // appears to be the name of a function but either isn't defined or isn't + // visible in the scope in which it's being referenced. + // + // #### Examples + // + // The following code produces this diagnostic because the name `emty` isn't + // defined: + // + // ```dart + // List empty() => []; + // + // void main() { + // print([!emty!]()); + // } + // ``` + // + // #### Common fixes + // + // If the identifier isn't defined, then either define it or replace it with + // the name of a function that is defined. The example above can be corrected + // by fixing the spelling of the function: + // + // ```dart + // List empty() => []; + // + // void main() { + // print(empty()); + // } + // ``` + // + // If the function is defined but isn't visible, then you probably need to add + // an import or re-arrange your code to make the function visible. + static const CompileTimeErrorCode UNDEFINED_FUNCTION = CompileTimeErrorCode( + 'UNDEFINED_FUNCTION', "The function '{0}' isn't defined.", + correction: "Try importing the library that defines '{0}', " + "correcting the name to the name of an existing function, or " + "defining a function named '{0}'.", + hasPublishedDocs: true, + isUnresolvedIdentifier: true); + + /** + * Parameters: + * 0: the name of the getter + * 1: the name of the enclosing type where the getter is being looked for + */ + // #### Description + // + // The analyzer produces this diagnostic when it encounters an identifier that + // appears to be the name of a getter but either isn't defined or isn't + // visible in the scope in which it's being referenced. + // + // #### Examples + // + // The following code produces this diagnostic because `String` has no member + // named `len`: + // + // ```dart + // int f(String s) => s.[!len!]; + // ``` + // + // #### Common fixes + // + // If the identifier isn't defined, then either define it or replace it with + // the name of a getter that is defined. The example above can be corrected by + // fixing the spelling of the getter: + // + // ```dart + // int f(String s) => s.length; + // ``` + static const CompileTimeErrorCode UNDEFINED_GETTER = CompileTimeErrorCode( + 'UNDEFINED_GETTER', "The getter '{0}' isn't defined for the type '{1}'.", + correction: "Try importing the library that defines '{0}', " + "correcting the name to the name of an existing getter, or " + "defining a getter or field named '{0}'.", + hasPublishedDocs: true); + /** * Parameters: * 0: the name of the identifier @@ -8681,6 +9428,42 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { "adding 'async' to the enclosing function body.", hasPublishedDocs: true); + /** + * Parameters: + * 0: the name of the method that is undefined + * 1: the resolved type name that the method lookup is happening on + */ + // #### Description + // + // The analyzer produces this diagnostic when it encounters an identifier that + // appears to be the name of a method but either isn't defined or isn't + // visible in the scope in which it's being referenced. + // + // #### Examples + // + // The following code produces this diagnostic because the identifier + // `removeMiddle` isn't defined: + // + // ```dart + // int f(List l) => l.[!removeMiddle!](); + // ``` + // + // #### Common fixes + // + // If the identifier isn't defined, then either define it or replace it with + // the name of a method that is defined. The example above can be corrected by + // fixing the spelling of the method: + // + // ```dart + // int f(List l) => l.removeLast(); + // ``` + static const CompileTimeErrorCode UNDEFINED_METHOD = CompileTimeErrorCode( + 'UNDEFINED_METHOD', "The method '{0}' isn't defined for the type '{1}'.", + correction: + "Try correcting the name to the name of an existing method, or " + "defining a method named '{0}'.", + hasPublishedDocs: true); + /** * Parameters: * 0: the name of the requested named parameter @@ -8757,6 +9540,245 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { "or defining a named parameter with the name '{0}'.", hasPublishedDocs: true); + /** + * Parameters: + * 0: the name of the operator + * 1: the name of the enclosing type where the operator is being looked for + */ + // #### Description + // + // The analyzer produces this diagnostic when a user-definable operator is + // invoked on an object for which the operator isn't defined. + // + // #### Examples + // + // The following code produces this diagnostic because the class `C` doesn't + // define the operator `+`: + // + // ```dart + // class C {} + // + // C f(C c) => c [!+!] 2; + // ``` + // + // #### Common fixes + // + // If the operator should be defined for the class, then define it: + // + // ```dart + // class C { + // C operator +(int i) => this; + // } + // + // C f(C c) => c + 2; + // ``` + static const CompileTimeErrorCode UNDEFINED_OPERATOR = CompileTimeErrorCode( + 'UNDEFINED_OPERATOR', + "The operator '{0}' isn't defined for the type '{1}'.", + correction: "Try defining the operator '{0}'.", + hasPublishedDocs: true); + + /** + * No parameters. + */ + // #### Description + // + // The analyzer produces this diagnostic when a prefixed identifier is found + // where the prefix is valid, but the identifier isn't declared in any of the + // libraries imported using that prefix. + // + // #### Examples + // + // The following code produces this diagnostic because `dart:core` doesn't + // define anything named `a`: + // + // ```dart + // import 'dart:core' as p; + // + // void f() { + // p.[!a!]; + // } + // ``` + // + // #### Common fixes + // + // If the library in which the name is declared isn't imported yet, add an + // import for the library. + // + // If the name is wrong, then change it to one of the names that's declared in + // the imported libraries. + static const CompileTimeErrorCode UNDEFINED_PREFIXED_NAME = + CompileTimeErrorCode( + 'UNDEFINED_PREFIXED_NAME', + "The name '{0}' is being referenced through the prefix '{1}', but it " + "isn't defined in any of the libraries imported using that " + "prefix.", + correction: "Try correcting the prefix or " + "importing the library that defines '{0}'.", + hasPublishedDocs: true); + + /** + * Parameters: + * 0: the name of the setter + * 1: the name of the enclosing type where the setter is being looked for + */ + // #### Description + // + // The analyzer produces this diagnostic when it encounters an identifier that + // appears to be the name of a setter but either isn't defined or isn't + // visible in the scope in which the identifier is being referenced. + // + // #### Examples + // + // The following code produces this diagnostic because there isn't a setter + // named `z`: + // + // ```dart + // class C { + // int x = 0; + // void m(int y) { + // this.[!z!] = y; + // } + // } + // ``` + // + // #### Common fixes + // + // If the identifier isn't defined, then either define it or replace it with + // the name of a setter that is defined. The example above can be corrected by + // fixing the spelling of the setter: + // + // ```dart + // class C { + // int x = 0; + // void m(int y) { + // this.x = y; + // } + // } + // ``` + static const CompileTimeErrorCode UNDEFINED_SETTER = CompileTimeErrorCode( + 'UNDEFINED_SETTER', "The setter '{0}' isn't defined for the type '{1}'.", + correction: "Try importing the library that defines '{0}', " + "correcting the name to the name of an existing setter, or " + "defining a setter or field named '{0}'.", + hasPublishedDocs: true); + + /** + * 12.17 Getter Invocation: Let T be the static type of e. It is + * a static type warning if T does not have a getter named m. + * + * Parameters: + * 0: the name of the getter + * 1: the name of the enclosing type where the getter is being looked for + */ + static const CompileTimeErrorCode UNDEFINED_SUPER_GETTER = + CompileTimeErrorCode('UNDEFINED_SUPER_GETTER', + "The getter '{0}' isn't defined in a superclass of '{1}'.", + correction: + "Try correcting the name to the name of an existing getter, or " + "defining a getter or field named '{0}' in a superclass."); + + /** + * Parameters: + * 0: the name of the method that is undefined + * 1: the resolved type name that the method lookup is happening on + */ + // #### Description + // + // The analyzer produces this diagnostic when an inherited method is + // referenced using `super`, but there’s no method with that name in the + // superclass chain. + // + // #### Examples + // + // The following code produces this diagnostic because `Object` doesn't define + // a member named `n`: + // + // ```dart + // class C { + // void m() { + // super.[!n!](); + // } + // } + // ``` + // + // #### Common fixes + // + // If the inherited method you intend to invoke has a different name, then + // make the name of the invoked method match the inherited method. + // + // If the method you intend to invoke is defined in the same class, then + // remove the `super.`. + // + // If not, then either add the method to one of the superclasses or remove the + // invocation. + static const CompileTimeErrorCode UNDEFINED_SUPER_METHOD = + CompileTimeErrorCode('UNDEFINED_SUPER_METHOD', + "The method '{0}' isn't defined in a superclass of '{1}'.", + correction: + "Try correcting the name to the name of an existing method, or " + "defining a method named '{0}' in a superclass.", + hasPublishedDocs: true); + + /** + * 12.18 Assignment: Evaluation of an assignment of the form + * e1[e2] = e3 is + * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e); + * return e;} (e1, e2, + * e2). + * + * 12.29 Assignable Expressions: An assignable expression of the form + * e1[e2] is evaluated as a method + * invocation of the operator method [] on e1 with argument + * e2. + * + * 12.15.1 Ordinary Invocation: Let T be the static type of o. + * It is a static type warning if T does not have an accessible + * instance member named m. + * + * Parameters: + * 0: the name of the operator + * 1: the name of the enclosing type where the operator is being looked for + */ + static const CompileTimeErrorCode UNDEFINED_SUPER_OPERATOR = + CompileTimeErrorCode('UNDEFINED_SUPER_OPERATOR', + "The operator '{0}' isn't defined in a superclass of '{1}'.", + correction: "Try defining the operator '{0}' in a superclass."); + + /** + * 12.18 Assignment: Let T be the static type of e1. + * It is a static type warning if T does not have an accessible + * instance setter named v=. + * + * Parameters: + * 0: the name of the setter + * 1: the name of the enclosing type where the setter is being looked for + */ + static const CompileTimeErrorCode UNDEFINED_SUPER_SETTER = + CompileTimeErrorCode('UNDEFINED_SUPER_SETTER', + "The setter '{0}' isn't defined in a superclass of '{1}'.", + correction: + "Try correcting the name to the name of an existing setter, or " + "defining a setter or field named '{0}' in a superclass."); + + /** + * 12.15.1 Ordinary Invocation: It is a static type warning if T does + * not have an accessible (3.2) instance member named m. + * + * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used + * when we are able to find the name defined in a supertype. It exists to + * provide a more informative error message. + * + * Parameters: + * 0: the name of the defining type + */ + static const CompileTimeErrorCode + UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER = CompileTimeErrorCode( + 'UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', + "Static members from supertypes must be qualified by the name of the " + "defining type.", + correction: "Try adding '{0}.' before the name."); + /** * Parameters: * 0: the name of the defining type @@ -9068,6 +10090,92 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { "Setters must declare exactly one required positional parameter.", hasPublishedDocs: true); + /** + * Parameters: + * 0: the name of the type being referenced (G) + * 1: the number of type parameters that were declared + * 2: the number of type arguments provided + */ + // #### Description + // + // The analyzer produces this diagnostic when a type that has type parameters + // is used and type arguments are provided, but the number of type arguments + // isn't the same as the number of type parameters. + // + // The analyzer also produces this diagnostic when a constructor is invoked + // and the number of type arguments doesn't match the number of type + // parameters declared for the class. + // + // #### Examples + // + // The following code produces this diagnostic because `C` has one type + // parameter but two type arguments are provided when it is used as a type + // annotation: + // + // ```dart + // class C {} + // + // void f([!C!] x) {} + // ``` + // + // The following code produces this diagnostic because `C` declares one type + // parameter, but two type arguments are provided when creating an instance: + // + // ```dart + // class C {} + // + // var c = [!C!](); + // ``` + // + // #### Common fixes + // + // Add or remove type arguments, as necessary, to match the number of type + // parameters defined for the type: + // + // ```dart + // class C {} + // + // void f(C x) {} + // ``` + static const CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = + CompileTimeErrorCode( + 'WRONG_NUMBER_OF_TYPE_ARGUMENTS', + "The type '{0}' is declared with {1} type parameters, " + "but {2} type arguments were given.", + correction: + "Try adjusting the number of type arguments to match the number " + "of type parameters.", + hasPublishedDocs: true); + + /** + * It will be a static type warning if m is not a generic method with + * exactly n type parameters. + * + * Parameters: + * 0: the name of the class being instantiated + * 1: the name of the constructor being invoked + */ + static const CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR = + CompileTimeErrorCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR', + "The constructor '{0}.{1}' doesn't have type parameters.", + correction: "Try moving type arguments to after the type name."); + + /** + * It will be a static type warning if m is not a generic method with + * exactly n type parameters. + * + * Parameters: + * 0: the name of the method being referenced (G) + * 1: the number of type parameters that were declared + * 2: the number of type arguments provided + */ + static const CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD = + CompileTimeErrorCode( + 'WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD', + "The method '{0}' is declared with {1} type parameters, " + "but {2} type arguments were given.", + correction: "Try adjusting the number of type arguments."); + /** * Let `C` be a generic class that declares a formal type parameter `X`, and * assume that `T` is a direct superinterface of `C`. It is a compile-time @@ -9133,6 +10241,30 @@ class CompileTimeErrorCode extends AnalyzerErrorCode { correction: "Try adding 'async*' or 'sync*' to the enclosing function."); + /** + * 17.16.1 Yield: Let T be the static type of e [the expression to the right + * of "yield"] and let f be the immediately enclosing function. It is a + * static type warning if either: + * + * - the body of f is marked async* and the type Stream may not be + * assigned to the declared return type of f. + * + * - the body of f is marked sync* and the type Iterable may not be + * assigned to the declared return type of f. + * + * 17.16.2 Yield-Each: Let T be the static type of e [the expression to the + * right of "yield*"] and let f be the immediately enclosing function. It is + * a static type warning if T may not be assigned to the declared return type + * of f. If f is synchronous it is a static type warning if T may not be + * assigned to Iterable. If f is asynchronous it is a static type warning if + * T may not be assigned to Stream. + */ + static const CompileTimeErrorCode YIELD_OF_INVALID_TYPE = + CompileTimeErrorCode( + 'YIELD_OF_INVALID_TYPE', + "The type '{0}' implied by the 'yield' expression must be assignable " + "to '{1}'."); + /** * Initialize a newly created error code to have the given [name]. The message * associated with the error will be created from the given [message] @@ -9170,1178 +10302,6 @@ class CompileTimeErrorCodeWithUniqueName extends CompileTimeErrorCode { isUnresolvedIdentifier: isUnresolvedIdentifier); } -/** - * The error codes used for static type warnings. The convention for this class - * is for the name of the error code to indicate the problem that caused the - * error to be generated and for the error message to explain what is wrong and, - * when appropriate, how the problem can be corrected. - */ -class StaticTypeWarningCode extends AnalyzerErrorCode { - /** - * 12.7 Lists: A fresh instance (7.6.1) a, of size n, whose - * class implements the built-in class List<E> is allocated. - * - * Parameters: - * 0: the number of provided type arguments - */ - static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = - StaticTypeWarningCode( - 'EXPECTED_ONE_LIST_TYPE_ARGUMENTS', - "List literals require exactly one type argument or none, " - "but {0} found.", - correction: "Try adjusting the number of type arguments."); - - /** - * Parameters: - * 0: the number of provided type arguments - */ - static const StaticTypeWarningCode EXPECTED_ONE_SET_TYPE_ARGUMENTS = - StaticTypeWarningCode( - 'EXPECTED_ONE_SET_TYPE_ARGUMENTS', - "Set literals require exactly one type argument or none, " - "but {0} found.", - correction: "Try adjusting the number of type arguments."); - - /** - * 12.8 Maps: A fresh instance (7.6.1) m, of size n, whose class - * implements the built-in class Map<K, V> is allocated. - * - * Parameters: - * 0: the number of provided type arguments - */ - static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = - StaticTypeWarningCode( - 'EXPECTED_TWO_MAP_TYPE_ARGUMENTS', - "Map literals require exactly two type arguments or none, " - "but {0} found.", - correction: "Try adjusting the number of type arguments."); - - /** - * 17.6.2 For-in. It the iterable expression does not implement Iterable with - * a type argument that can be assigned to the for-in variable's type, this - * warning is reported. - * - * Parameters: - * 0: The type of the iterable expression. - * 1: The sequence type -- Iterable for `for` or Stream for `await for`. - * 2: The loop variable type. - */ - static const StaticTypeWarningCode FOR_IN_OF_INVALID_ELEMENT_TYPE = - StaticTypeWarningCode( - 'FOR_IN_OF_INVALID_ELEMENT_TYPE', - "The type '{0}' used in the 'for' loop must implement {1} with a " - "type argument that can be assigned to '{2}'."); - - /** - * Parameters: - * 0: The type of the iterable expression. - * 1: The sequence type -- Iterable for `for` or Stream for `await for`. - */ - // #### Description - // - // The analyzer produces this diagnostic when the expression following `in` in - // a for-in loop has a type that isn't a subclass of `Iterable`. - // - // #### Examples - // - // The following code produces this diagnostic because `m` is a `Map`, and - // `Map` isn't a subclass of `Iterable`: - // - // ```dart - // void f(Map m) { - // for (String s in [!m!]) { - // print(s); - // } - // } - // ``` - // - // #### Common fixes - // - // Replace the expression with one that produces an iterable value: - // - // ```dart - // void f(Map m) { - // for (String s in m.values) { - // print(s); - // } - // } - // ``` - static const StaticTypeWarningCode FOR_IN_OF_INVALID_TYPE = - StaticTypeWarningCode('FOR_IN_OF_INVALID_TYPE', - "The type '{0}' used in the 'for' loop must implement {1}.", - hasPublishedDocs: true); - - /** - * No parameters. - */ - // #### Description - // - // The analyzer produces this diagnostic when the body of a function has the - // `async` modifier even though the return type of the function isn't - // assignable to `Future`. - // - // #### Example - // - // The following code produces this diagnostic because the body of the - // function `f` has the `async` modifier even though the return type isn't - // assignable to `Future`: - // - // ```dart - // [!int!] f() async { - // return 0; - // } - // ``` - // - // #### Common fixes - // - // If the function should be asynchronous, then change the return type to be - // assignable to `Future`: - // - // ```dart - // Future f() async { - // return 0; - // } - // ``` - // - // If the function should be synchronous, then remove the `async` modifier: - // - // ```dart - // int f() { - // return 0; - // } - // ``` - static const StaticTypeWarningCode ILLEGAL_ASYNC_RETURN_TYPE = - StaticTypeWarningCode( - 'ILLEGAL_ASYNC_RETURN_TYPE', - "Functions marked 'async' must have a return type assignable to " - "'Future'.", - correction: "Try fixing the return type of the function, or " - "removing the modifier 'async' from the function body.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the name of the static member - * 1: the kind of the static member (field, getter, setter, or method) - * 2: the name of the defining class - */ - // #### Description - // - // The analyzer produces this diagnostic when an access operator is used to - // access a static member through an instance of the class. - // - // #### Examples - // - // The following code produces this diagnostic because `zero` is a static - // field, but it’s being accessed as if it were an instance field: - // - // ```dart - // void f(C c) { - // c.[!zero!]; - // } - // - // class C { - // static int zero = 0; - // } - // ``` - // - // #### Common fixes - // - // Use the class to access the static member: - // - // ```dart - // void f(C c) { - // C.zero; - // } - // - // class C { - // static int zero = 0; - // } - // ``` - static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = - StaticTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER', - "Static {1} '{0}' can't be accessed through an instance.", - correction: "Try using the class '{2}' to access the {1}.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the name of the right hand side type - * 1: the name of the left hand side type - */ - // #### Description - // - // The analyzer produces this diagnostic when the static type of an expression - // that is assigned to a variable isn't assignable to the type of the - // variable. - // - // #### Examples - // - // The following code produces this diagnostic because the type of the - // initializer (`int`) isn't assignable to the type of the variable - // (`String`): - // - // ```dart - // int i = 0; - // String s = [!i!]; - // ``` - // - // #### Common fixes - // - // If the value being assigned is always assignable at runtime, even though - // the static types don't reflect that, then add an explicit cast. - // - // Otherwise, change the value being assigned so that it has the expected - // type. In the previous example, this might look like: - // - // ```dart - // int i = 0; - // String s = i.toString(); - // ``` - // - // If you can’t change the value, then change the type of the variable to be - // compatible with the type of the value being assigned: - // - // ```dart - // int i = 0; - // int s = i; - // ``` - static const StaticTypeWarningCode INVALID_ASSIGNMENT = StaticTypeWarningCode( - 'INVALID_ASSIGNMENT', - "A value of type '{0}' can't be assigned to a variable of type " - "'{1}'.", - correction: "Try changing the type of the variable, or " - "casting the right-hand type to '{1}'.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the name of the identifier that is not a function type - */ - // #### Description - // - // The analyzer produces this diagnostic when it finds a function invocation, - // but the name of the function being invoked is defined to be something other - // than a function. - // - // #### Examples - // - // The following code produces this diagnostic because `Binary` is the name of - // a function type, not a function: - // - // ```dart - // typedef Binary = int Function(int, int); - // - // int f() { - // return [!Binary!](1, 2); - // } - // ``` - // - // #### Common fixes - // - // Replace the name with the name of a function. - static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = - StaticTypeWarningCode( - 'INVOCATION_OF_NON_FUNCTION', "'{0}' isn't a function.", - // TODO(brianwilkerson) Split this error code so that we can provide - // better error and correction messages. - correction: - "Try correcting the name to match an existing function, or " - "define a method or function named '{0}'.", - hasPublishedDocs: true); - - /** - * No parameters. - */ - // #### Description - // - // The analyzer produces this diagnostic when a function invocation is found, - // but the name being referenced isn't the name of a function, or when the - // expression computing the function doesn't compute a function. - // - // #### Examples - // - // The following code produces this diagnostic because `x` isn't a function: - // - // ```dart - // int x = 0; - // - // int f() => x; - // - // var y = [!x!](); - // ``` - // - // The following code produces this diagnostic because `f()` doesn't return a - // function: - // - // ```dart - // int x = 0; - // - // int f() => x; - // - // var y = [!f()!](); - // ``` - // - // #### Common fixes - // - // If you need to invoke a function, then replace the code before the argument - // list with the name of a function or with an expression that computes a - // function: - // - // ```dart - // int x = 0; - // - // int f() => x; - // - // var y = f(); - // ``` - static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = - StaticTypeWarningCode( - 'INVOCATION_OF_NON_FUNCTION_EXPRESSION', - "The expression doesn't evaluate to a function, so it can't be " - "invoked.", - hasPublishedDocs: true); - - /** - * No parameters. - */ - // #### Description - // - // The analyzer produces this diagnostic when a condition, such as an `if` or - // `while` loop, doesn't have the static type `bool`. - // - // #### Examples - // - // The following code produces this diagnostic because `x` has the static type - // `int`: - // - // ```dart - // void f(int x) { - // if ([!x!]) { - // // ... - // } - // } - // ``` - // - // #### Common fixes - // - // Change the condition so that it produces a Boolean value: - // - // ```dart - // void f(int x) { - // if (x == 0) { - // // ... - // } - // } - // ``` - static const StaticTypeWarningCode NON_BOOL_CONDITION = StaticTypeWarningCode( - 'NON_BOOL_CONDITION', "Conditions must have a static type of 'bool'.", - correction: "Try changing the condition.", hasPublishedDocs: true); - - /** - * No parameters. - */ - // #### Description - // - // The analyzer produces this diagnostic when the first expression in an - // assert has a type other than `bool`. - // - // #### Examples - // - // The following code produces this diagnostic because the type of `p` is - // `int`, but a `bool` is required: - // - // ```dart - // void f(int p) { - // assert([!p!]); - // } - // ``` - // - // #### Common fixes - // - // Change the expression so that it has the type `bool`: - // - // ```dart - // void f(int p) { - // assert(p > 0); - // } - // ``` - static const StaticTypeWarningCode NON_BOOL_EXPRESSION = - StaticTypeWarningCode('NON_BOOL_EXPRESSION', - "The expression in an assert must be of type 'bool'.", - correction: "Try changing the expression.", hasPublishedDocs: true); - - /** - * No parameters. - */ - // #### Description - // - // The analyzer produces this diagnostic when the operand of the unary - // negation operator (`!`) doesn't have the type `bool`. - // - // #### Examples - // - // The following code produces this diagnostic because `x` is an `int` when it - // must be a `bool`: - // - // ```dart - // int x = 0; - // bool y = ![!x!]; - // ``` - // - // #### Common fixes - // - // Replace the operand with an expression that has the type `bool`: - // - // ```dart - // int x = 0; - // bool y = !(x > 0); - // ``` - static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = - StaticTypeWarningCode('NON_BOOL_NEGATION_EXPRESSION', - "A negation operand must have a static type of 'bool'.", - correction: "Try changing the operand to the '!' operator.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the lexeme of the logical operator - */ - // #### Description - // - // The analyzer produces this diagnostic when one of the operands of either - // the `&&` or `||` operator doesn't have the type `bool`. - // - // #### Examples - // - // The following code produces this diagnostic because `a` isn't a Boolean - // value: - // - // ```dart - // int a = 3; - // bool b = [!a!] || a > 1; - // ``` - // - // #### Common fixes - // - // Change the operand to a Boolean value: - // - // ```dart - // int a = 3; - // bool b = a == 0 || a > 1; - // ``` - static const StaticTypeWarningCode NON_BOOL_OPERAND = StaticTypeWarningCode( - 'NON_BOOL_OPERAND', - "The operands of the operator '{0}' must be assignable to 'bool'.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the name appearing where a type is expected - */ - // #### Description - // - // The analyzer produces this diagnostic when an identifier that isn't a type - // is used as a type argument. - // - // #### Examples - // - // The following code produces this diagnostic because `x` is a variable, not - // a type: - // - // ```dart - // var x = 0; - // List<[!x!]> xList = []; - // ``` - // - // #### Common fixes - // - // Change the type argument to be a type: - // - // ```dart - // var x = 0; - // List xList = []; - // ``` - static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = - StaticTypeWarningCode('NON_TYPE_AS_TYPE_ARGUMENT', - "The name '{0}' isn't a type so it can't be used as a type argument.", - correction: "Try correcting the name to an existing type, or " - "defining a type named '{0}'.", - hasPublishedDocs: true, - isUnresolvedIdentifier: true); - - /** - * Parameters: - * 0: the return type as declared in the return statement - * 1: the expected return type as defined by the method - */ - // #### Description - // - // The analyzer produces this diagnostic when the static type of a returned - // expression isn't assignable to the return type that the closure is required - // to have. - // - // #### Examples - // - // The following code produces this diagnostic because `f` is defined to be a - // function that returns a `String`, but the closure assigned to it returns an - // `int`: - // - // ```dart - // String Function(String) f = (s) => [!3!]; - // ``` - // - // #### Common fixes - // - // If the return type is correct, then replace the returned value with a value - // of the correct type, possibly by converting the existing value: - // - // ```dart - // String Function(String) f = (s) => 3.toString(); - // ``` - static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE_FROM_CLOSURE = - StaticTypeWarningCode( - 'RETURN_OF_INVALID_TYPE_FROM_CLOSURE', - "The return type '{0}' isn't a '{1}', as required by the closure's " - "context.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the return type as declared in the return statement - * 1: the expected return type as defined by the enclosing class - * 2: the name of the constructor - */ - static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR = - StaticTypeWarningCodeWithUniqueName( - 'RETURN_OF_INVALID_TYPE', - 'StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR', - "A value of type '{0}' can't be returned from constructor '{2}' " - "because it has a return type of '{1}'.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the return type as declared in the return statement - * 1: the expected return type as defined by the method - * 2: the name of the method - */ - // #### Description - // - // The analyzer produces this diagnostic when a method or function returns a - // value whose type isn't assignable to the declared return type. - // - // #### Examples - // - // The following code produces this diagnostic because `f` has a return type - // of `String` but is returning an `int`: - // - // ```dart - // String f() => [!3!]; - // ``` - // - // #### Common fixes - // - // If the return type is correct, then replace the value being returned with a - // value of the correct type, possibly by converting the existing value: - // - // ```dart - // String f() => 3.toString(); - // ``` - // - // If the value is correct, then change the return type to match: - // - // ```dart - // int f() => 3; - // ``` - static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE_FROM_FUNCTION = - StaticTypeWarningCodeWithUniqueName( - 'RETURN_OF_INVALID_TYPE', - 'StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION', - "A value of type '{0}' can't be returned from function '{2}' because " - "it has a return type of '{1}'.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the return type as declared in the return statement - * 1: the expected return type as defined by the method - * 2: the name of the method - */ - static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE_FROM_METHOD = - StaticTypeWarningCodeWithUniqueName( - 'RETURN_OF_INVALID_TYPE', - 'StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_METHOD', - "A value of type '{0}' can't be returned from method '{2}' because " - "it has a return type of '{1}'.", - hasPublishedDocs: true); - - /** - * 10 Generics: It is a static type warning if a type parameter is a supertype - * of its upper bound. - * - * Parameters: - * 0: the name of the type parameter - * 1: the name of the bounding type - * - * See [CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]. - */ - static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = - StaticTypeWarningCode('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', - "'{0}' can't be a supertype of its upper bound.", - correction: "Try using a type that is or is a subclass of '{1}'."); - - /** - * Parameters: - * 0: the name of the enumeration constant that is not defined - * 1: the name of the enumeration used to access the constant - */ - // #### Description - // - // The analyzer produces this diagnostic when it encounters an identifier that - // appears to be the name of an enum constant, and the name either isn't - // defined or isn't visible in the scope in which it's being referenced. - // - // #### Examples - // - // The following code produces this diagnostic because `E` doesn't define a - // constant named `c`: - // - // ```dart - // enum E {a, b} - // - // var e = E.[!c!]; - // ``` - // - // #### Common fixes - // - // If the constant should be defined, then add it to the declaration of the - // enum: - // - // ```dart - // enum E {a, b, c} - // - // var e = E.c; - // ``` - // - // If the constant shouldn't be defined, then change the name to the name of - // an existing constant: - // - // ```dart - // enum E {a, b} - // - // var e = E.b; - // ``` - static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT = - StaticTypeWarningCode('UNDEFINED_ENUM_CONSTANT', - "There's no constant named '{0}' in '{1}'.", - correction: - "Try correcting the name to the name of an existing constant, or " - "defining a constant named '{0}'.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the name of the method that is undefined - */ - // #### Description - // - // The analyzer produces this diagnostic when it encounters an identifier that - // appears to be the name of a function but either isn't defined or isn't - // visible in the scope in which it's being referenced. - // - // #### Examples - // - // The following code produces this diagnostic because the name `emty` isn't - // defined: - // - // ```dart - // List empty() => []; - // - // void main() { - // print([!emty!]()); - // } - // ``` - // - // #### Common fixes - // - // If the identifier isn't defined, then either define it or replace it with - // the name of a function that is defined. The example above can be corrected - // by fixing the spelling of the function: - // - // ```dart - // List empty() => []; - // - // void main() { - // print(empty()); - // } - // ``` - // - // If the function is defined but isn't visible, then you probably need to add - // an import or re-arrange your code to make the function visible. - static const StaticTypeWarningCode UNDEFINED_FUNCTION = StaticTypeWarningCode( - 'UNDEFINED_FUNCTION', "The function '{0}' isn't defined.", - correction: "Try importing the library that defines '{0}', " - "correcting the name to the name of an existing function, or " - "defining a function named '{0}'.", - hasPublishedDocs: true, - isUnresolvedIdentifier: true); - - /** - * Parameters: - * 0: the name of the getter - * 1: the name of the enclosing type where the getter is being looked for - */ - // #### Description - // - // The analyzer produces this diagnostic when it encounters an identifier that - // appears to be the name of a getter but either isn't defined or isn't - // visible in the scope in which it's being referenced. - // - // #### Examples - // - // The following code produces this diagnostic because `String` has no member - // named `len`: - // - // ```dart - // int f(String s) => s.[!len!]; - // ``` - // - // #### Common fixes - // - // If the identifier isn't defined, then either define it or replace it with - // the name of a getter that is defined. The example above can be corrected by - // fixing the spelling of the getter: - // - // ```dart - // int f(String s) => s.length; - // ``` - static const StaticTypeWarningCode UNDEFINED_GETTER = StaticTypeWarningCode( - 'UNDEFINED_GETTER', "The getter '{0}' isn't defined for the type '{1}'.", - correction: "Try importing the library that defines '{0}', " - "correcting the name to the name of an existing getter, or " - "defining a getter or field named '{0}'.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the name of the method that is undefined - * 1: the resolved type name that the method lookup is happening on - */ - // #### Description - // - // The analyzer produces this diagnostic when it encounters an identifier that - // appears to be the name of a method but either isn't defined or isn't - // visible in the scope in which it's being referenced. - // - // #### Examples - // - // The following code produces this diagnostic because the identifier - // `removeMiddle` isn't defined: - // - // ```dart - // int f(List l) => l.[!removeMiddle!](); - // ``` - // - // #### Common fixes - // - // If the identifier isn't defined, then either define it or replace it with - // the name of a method that is defined. The example above can be corrected by - // fixing the spelling of the method: - // - // ```dart - // int f(List l) => l.removeLast(); - // ``` - static const StaticTypeWarningCode UNDEFINED_METHOD = StaticTypeWarningCode( - 'UNDEFINED_METHOD', "The method '{0}' isn't defined for the type '{1}'.", - correction: - "Try correcting the name to the name of an existing method, or " - "defining a method named '{0}'.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the name of the operator - * 1: the name of the enclosing type where the operator is being looked for - */ - // #### Description - // - // The analyzer produces this diagnostic when a user-definable operator is - // invoked on an object for which the operator isn't defined. - // - // #### Examples - // - // The following code produces this diagnostic because the class `C` doesn't - // define the operator `+`: - // - // ```dart - // class C {} - // - // C f(C c) => c [!+!] 2; - // ``` - // - // #### Common fixes - // - // If the operator should be defined for the class, then define it: - // - // ```dart - // class C { - // C operator +(int i) => this; - // } - // - // C f(C c) => c + 2; - // ``` - static const StaticTypeWarningCode UNDEFINED_OPERATOR = StaticTypeWarningCode( - 'UNDEFINED_OPERATOR', - "The operator '{0}' isn't defined for the type '{1}'.", - correction: "Try defining the operator '{0}'.", - hasPublishedDocs: true); - - /** - * No parameters. - */ - // #### Description - // - // The analyzer produces this diagnostic when a prefixed identifier is found - // where the prefix is valid, but the identifier isn't declared in any of the - // libraries imported using that prefix. - // - // #### Examples - // - // The following code produces this diagnostic because `dart:core` doesn't - // define anything named `a`: - // - // ```dart - // import 'dart:core' as p; - // - // void f() { - // p.[!a!]; - // } - // ``` - // - // #### Common fixes - // - // If the library in which the name is declared isn't imported yet, add an - // import for the library. - // - // If the name is wrong, then change it to one of the names that's declared in - // the imported libraries. - static const StaticTypeWarningCode UNDEFINED_PREFIXED_NAME = - StaticTypeWarningCode( - 'UNDEFINED_PREFIXED_NAME', - "The name '{0}' is being referenced through the prefix '{1}', but it " - "isn't defined in any of the libraries imported using that " - "prefix.", - correction: "Try correcting the prefix or " - "importing the library that defines '{0}'.", - hasPublishedDocs: true); - - /** - * Parameters: - * 0: the name of the setter - * 1: the name of the enclosing type where the setter is being looked for - */ - // #### Description - // - // The analyzer produces this diagnostic when it encounters an identifier that - // appears to be the name of a setter but either isn't defined or isn't - // visible in the scope in which the identifier is being referenced. - // - // #### Examples - // - // The following code produces this diagnostic because there isn't a setter - // named `z`: - // - // ```dart - // class C { - // int x = 0; - // void m(int y) { - // this.[!z!] = y; - // } - // } - // ``` - // - // #### Common fixes - // - // If the identifier isn't defined, then either define it or replace it with - // the name of a setter that is defined. The example above can be corrected by - // fixing the spelling of the setter: - // - // ```dart - // class C { - // int x = 0; - // void m(int y) { - // this.x = y; - // } - // } - // ``` - static const StaticTypeWarningCode UNDEFINED_SETTER = StaticTypeWarningCode( - 'UNDEFINED_SETTER', "The setter '{0}' isn't defined for the type '{1}'.", - correction: "Try importing the library that defines '{0}', " - "correcting the name to the name of an existing setter, or " - "defining a setter or field named '{0}'.", - hasPublishedDocs: true); - - /** - * 12.17 Getter Invocation: Let T be the static type of e. It is - * a static type warning if T does not have a getter named m. - * - * Parameters: - * 0: the name of the getter - * 1: the name of the enclosing type where the getter is being looked for - */ - static const StaticTypeWarningCode UNDEFINED_SUPER_GETTER = - StaticTypeWarningCode('UNDEFINED_SUPER_GETTER', - "The getter '{0}' isn't defined in a superclass of '{1}'.", - correction: - "Try correcting the name to the name of an existing getter, or " - "defining a getter or field named '{0}' in a superclass."); - - /** - * Parameters: - * 0: the name of the method that is undefined - * 1: the resolved type name that the method lookup is happening on - */ - // #### Description - // - // The analyzer produces this diagnostic when an inherited method is - // referenced using `super`, but there’s no method with that name in the - // superclass chain. - // - // #### Examples - // - // The following code produces this diagnostic because `Object` doesn't define - // a member named `n`: - // - // ```dart - // class C { - // void m() { - // super.[!n!](); - // } - // } - // ``` - // - // #### Common fixes - // - // If the inherited method you intend to invoke has a different name, then - // make the name of the invoked method match the inherited method. - // - // If the method you intend to invoke is defined in the same class, then - // remove the `super.`. - // - // If not, then either add the method to one of the superclasses or remove the - // invocation. - static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = - StaticTypeWarningCode('UNDEFINED_SUPER_METHOD', - "The method '{0}' isn't defined in a superclass of '{1}'.", - correction: - "Try correcting the name to the name of an existing method, or " - "defining a method named '{0}' in a superclass.", - hasPublishedDocs: true); - - /** - * 12.18 Assignment: Evaluation of an assignment of the form - * e1[e2] = e3 is - * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e); - * return e;} (e1, e2, - * e2). - * - * 12.29 Assignable Expressions: An assignable expression of the form - * e1[e2] is evaluated as a method - * invocation of the operator method [] on e1 with argument - * e2. - * - * 12.15.1 Ordinary Invocation: Let T be the static type of o. - * It is a static type warning if T does not have an accessible - * instance member named m. - * - * Parameters: - * 0: the name of the operator - * 1: the name of the enclosing type where the operator is being looked for - */ - static const StaticTypeWarningCode UNDEFINED_SUPER_OPERATOR = - StaticTypeWarningCode('UNDEFINED_SUPER_OPERATOR', - "The operator '{0}' isn't defined in a superclass of '{1}'.", - correction: "Try defining the operator '{0}' in a superclass."); - - /** - * 12.18 Assignment: Let T be the static type of e1. - * It is a static type warning if T does not have an accessible - * instance setter named v=. - * - * Parameters: - * 0: the name of the setter - * 1: the name of the enclosing type where the setter is being looked for - */ - static const StaticTypeWarningCode UNDEFINED_SUPER_SETTER = - StaticTypeWarningCode('UNDEFINED_SUPER_SETTER', - "The setter '{0}' isn't defined in a superclass of '{1}'.", - correction: - "Try correcting the name to the name of an existing setter, or " - "defining a setter or field named '{0}' in a superclass."); - - /** - * 12.15.1 Ordinary Invocation: It is a static type warning if T does - * not have an accessible (3.2) instance member named m. - * - * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used - * when we are able to find the name defined in a supertype. It exists to - * provide a more informative error message. - * - * Parameters: - * 0: the name of the defining type - */ - static const StaticTypeWarningCode - UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER = StaticTypeWarningCode( - 'UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', - "Static members from supertypes must be qualified by the name of the " - "defining type.", - correction: "Try adding '{0}.' before the name."); - - /** - * Parameters: - * 0: the name of the type being referenced (G) - * 1: the number of type parameters that were declared - * 2: the number of type arguments provided - */ - // #### Description - // - // The analyzer produces this diagnostic when a type that has type parameters - // is used and type arguments are provided, but the number of type arguments - // isn't the same as the number of type parameters. - // - // The analyzer also produces this diagnostic when a constructor is invoked - // and the number of type arguments doesn't match the number of type - // parameters declared for the class. - // - // #### Examples - // - // The following code produces this diagnostic because `C` has one type - // parameter but two type arguments are provided when it is used as a type - // annotation: - // - // ```dart - // class C {} - // - // void f([!C!] x) {} - // ``` - // - // The following code produces this diagnostic because `C` declares one type - // parameter, but two type arguments are provided when creating an instance: - // - // ```dart - // class C {} - // - // var c = [!C!](); - // ``` - // - // #### Common fixes - // - // Add or remove type arguments, as necessary, to match the number of type - // parameters defined for the type: - // - // ```dart - // class C {} - // - // void f(C x) {} - // ``` - static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = - StaticTypeWarningCode( - 'WRONG_NUMBER_OF_TYPE_ARGUMENTS', - "The type '{0}' is declared with {1} type parameters, " - "but {2} type arguments were given.", - correction: - "Try adjusting the number of type arguments to match the number " - "of type parameters.", - hasPublishedDocs: true); - - /** - * It will be a static type warning if m is not a generic method with - * exactly n type parameters. - * - * Parameters: - * 0: the name of the class being instantiated - * 1: the name of the constructor being invoked - */ - static const StaticTypeWarningCode - WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR = StaticTypeWarningCode( - 'WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR', - "The constructor '{0}.{1}' doesn't have type parameters.", - correction: "Try moving type arguments to after the type name."); - - /** - * It will be a static type warning if m is not a generic method with - * exactly n type parameters. - * - * Parameters: - * 0: the name of the method being referenced (G) - * 1: the number of type parameters that were declared - * 2: the number of type arguments provided - */ - static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD = - StaticTypeWarningCode( - 'WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD', - "The method '{0}' is declared with {1} type parameters, " - "but {2} type arguments were given.", - correction: "Try adjusting the number of type arguments."); - - /** - * 17.16.1 Yield: Let T be the static type of e [the expression to the right - * of "yield"] and let f be the immediately enclosing function. It is a - * static type warning if either: - * - * - the body of f is marked async* and the type Stream may not be - * assigned to the declared return type of f. - * - * - the body of f is marked sync* and the type Iterable may not be - * assigned to the declared return type of f. - * - * 17.16.2 Yield-Each: Let T be the static type of e [the expression to the - * right of "yield*"] and let f be the immediately enclosing function. It is - * a static type warning if T may not be assigned to the declared return type - * of f. If f is synchronous it is a static type warning if T may not be - * assigned to Iterable. If f is asynchronous it is a static type warning if - * T may not be assigned to Stream. - */ - static const StaticTypeWarningCode YIELD_OF_INVALID_TYPE = - StaticTypeWarningCode( - 'YIELD_OF_INVALID_TYPE', - "The type '{0}' implied by the 'yield' expression must be assignable " - "to '{1}'."); - - /** - * Initialize a newly created error code to have the given [name]. The message - * associated with the error will be created from the given [message] - * template. The correction associated with the error will be created from the - * given [correction] template. - */ - const StaticTypeWarningCode(String name, String message, - {String correction, - bool hasPublishedDocs, - bool isUnresolvedIdentifier = false}) - : super.temporary(name, message, - correction: correction, - hasPublishedDocs: hasPublishedDocs, - isUnresolvedIdentifier: isUnresolvedIdentifier); - - @override - ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; - - @override - ErrorType get type => ErrorType.STATIC_TYPE_WARNING; -} - -class StaticTypeWarningCodeWithUniqueName extends StaticTypeWarningCode { - @override - final String uniqueName; - - const StaticTypeWarningCodeWithUniqueName( - String name, this.uniqueName, String message, - {String correction, bool hasPublishedDocs}) - : super(name, message, - correction: correction, hasPublishedDocs: hasPublishedDocs); -} - /** * The error codes used for static warnings. The convention for this class is * for the name of the error code to indicate the problem that caused the error diff --git a/pkg/analyzer/lib/src/error/return_type_verifier.dart b/pkg/analyzer/lib/src/error/return_type_verifier.dart index 5e0ee73a78f..9d78748e903 100644 --- a/pkg/analyzer/lib/src/error/return_type_verifier.dart +++ b/pkg/analyzer/lib/src/error/return_type_verifier.dart @@ -119,7 +119,7 @@ class ReturnTypeVerifier { } else { checkElement( _typeProvider.futureElement, - StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE, + CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, ); } } else if (enclosingExecutable.isGenerator) { @@ -157,25 +157,25 @@ class ReturnTypeVerifier { void reportTypeError() { if (enclosingExecutable.isClosure) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, expression, [S, T], ); } else if (enclosingExecutable.isConstructor) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, expression, [S, T, enclosingExecutable.displayName], ); } else if (enclosingExecutable.isFunction) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, expression, [S, T, enclosingExecutable.displayName], ); } else if (enclosingExecutable.isMethod) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, expression, [S, T, enclosingExecutable.displayName], ); @@ -258,25 +258,25 @@ class ReturnTypeVerifier { void reportTypeError() { if (enclosingExecutable.isClosure) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, expression, [S, T], ); } else if (enclosingExecutable.isConstructor) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, expression, [S, T, enclosingExecutable.displayName], ); } else if (enclosingExecutable.isFunction) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, expression, [S, T, enclosingExecutable.displayName], ); } else if (enclosingExecutable.isMethod) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, expression, [S, T, enclosingExecutable.displayName], ); diff --git a/pkg/analyzer/lib/src/error/type_arguments_verifier.dart b/pkg/analyzer/lib/src/error/type_arguments_verifier.dart index ed3f577524d..ed0cec87e44 100644 --- a/pkg/analyzer/lib/src/error/type_arguments_verifier.dart +++ b/pkg/analyzer/lib/src/error/type_arguments_verifier.dart @@ -48,7 +48,7 @@ class TypeArgumentsVerifier { ); } _checkTypeArgumentCount(typeArguments, 1, - StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS); + CompileTimeErrorCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS); } _checkForImplicitDynamicTypedLiteral(node); } @@ -63,7 +63,7 @@ class TypeArgumentsVerifier { ); } _checkTypeArgumentCount(typeArguments, 2, - StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS); + CompileTimeErrorCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS); } _checkForImplicitDynamicTypedLiteral(node); } @@ -83,7 +83,7 @@ class TypeArgumentsVerifier { ); } _checkTypeArgumentCount(typeArguments, 1, - StaticTypeWarningCode.EXPECTED_ONE_SET_TYPE_ARGUMENTS); + CompileTimeErrorCode.EXPECTED_ONE_SET_TYPE_ARGUMENTS); } _checkForImplicitDynamicTypedLiteral(node); } diff --git a/pkg/analyzer/lib/src/fasta/error_converter.dart b/pkg/analyzer/lib/src/fasta/error_converter.dart index 16646b8ec59..2fd3549d7c5 100644 --- a/pkg/analyzer/lib/src/fasta/error_converter.dart +++ b/pkg/analyzer/lib/src/fasta/error_converter.dart @@ -130,7 +130,7 @@ class FastaErrorReporter { var type1 = arguments['type']; var type2 = arguments['type2']; errorReporter?.reportErrorForOffset( - StaticTypeWarningCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.INVALID_ASSIGNMENT, offset, length, [type1, type2]); @@ -288,15 +288,15 @@ class FastaErrorReporter { return; case "UNDEFINED_GETTER": errorReporter?.reportErrorForOffset( - StaticTypeWarningCode.UNDEFINED_GETTER, offset, length); + CompileTimeErrorCode.UNDEFINED_GETTER, offset, length); return; case "UNDEFINED_METHOD": errorReporter?.reportErrorForOffset( - StaticTypeWarningCode.UNDEFINED_METHOD, offset, length); + CompileTimeErrorCode.UNDEFINED_METHOD, offset, length); return; case "UNDEFINED_SETTER": errorReporter?.reportErrorForOffset( - StaticTypeWarningCode.UNDEFINED_SETTER, offset, length); + CompileTimeErrorCode.UNDEFINED_SETTER, offset, length); return; case "UNEXPECTED_DOLLAR_IN_STRING": errorReporter?.reportErrorForOffset( @@ -322,7 +322,7 @@ class FastaErrorReporter { return; case "WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR": errorReporter?.reportErrorMessage( - StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, offset, length, message); diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart index 7b6a003c0d9..e36b41b0327 100644 --- a/pkg/analyzer/lib/src/generated/element_resolver.dart +++ b/pkg/analyzer/lib/src/generated/element_resolver.dart @@ -521,7 +521,7 @@ class ElementResolver extends SimpleAstVisitor { [identifier.name]); } else { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.UNDEFINED_PREFIXED_NAME, + CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, identifier, [identifier.name, prefixElement.name]); } @@ -851,7 +851,7 @@ class ElementResolver extends SimpleAstVisitor { } /// Check that the given index [expression] was resolved, otherwise a - /// [StaticTypeWarningCode.UNDEFINED_OPERATOR] is generated. The [target] is + /// [CompileTimeErrorCode.UNDEFINED_OPERATOR] is generated. The [target] is /// the target of the expression. The [methodName] is the name of the operator /// associated with the context of using of the given index expression. void _checkForUndefinedIndexOperator( @@ -886,7 +886,7 @@ class ElementResolver extends SimpleAstVisitor { ); } else if (target is SuperExpression) { _errorReporter.reportErrorForOffset( - StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, + CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, offset, length, [methodName, staticType], @@ -904,7 +904,7 @@ class ElementResolver extends SimpleAstVisitor { ); } else { _errorReporter.reportErrorForOffset( - StaticTypeWarningCode.UNDEFINED_OPERATOR, + CompileTimeErrorCode.UNDEFINED_OPERATOR, offset, length, [methodName, staticType], @@ -1320,8 +1320,8 @@ class ElementResolver extends SimpleAstVisitor { _checkForStaticAccessToInstanceMember(propertyName, element); } else { var code = typeReference.isEnum - ? StaticTypeWarningCode.UNDEFINED_ENUM_CONSTANT - : StaticTypeWarningCode.UNDEFINED_GETTER; + ? CompileTimeErrorCode.UNDEFINED_ENUM_CONSTANT + : CompileTimeErrorCode.UNDEFINED_GETTER; _errorReporter.reportErrorForNode( code, propertyName, @@ -1356,7 +1356,7 @@ class ElementResolver extends SimpleAstVisitor { // The error will be reported in ErrorVerifier. } else { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.UNDEFINED_SETTER, + CompileTimeErrorCode.UNDEFINED_SETTER, propertyName, [propertyName.name, typeReference.name], ); @@ -1392,7 +1392,7 @@ class ElementResolver extends SimpleAstVisitor { ); } else { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.UNDEFINED_SUPER_GETTER, + CompileTimeErrorCode.UNDEFINED_SUPER_GETTER, propertyName, [propertyName.name, staticType], ); @@ -1433,7 +1433,7 @@ class ElementResolver extends SimpleAstVisitor { } } else { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.UNDEFINED_SUPER_SETTER, + CompileTimeErrorCode.UNDEFINED_SUPER_SETTER, propertyName, [propertyName.name, staticType], ); @@ -1494,7 +1494,7 @@ class ElementResolver extends SimpleAstVisitor { } if (shouldReportUndefinedGetter) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.UNDEFINED_GETTER, + CompileTimeErrorCode.UNDEFINED_GETTER, propertyName, [propertyName.name, staticType], ); @@ -1517,7 +1517,7 @@ class ElementResolver extends SimpleAstVisitor { // OK } else { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.UNDEFINED_SETTER, + CompileTimeErrorCode.UNDEFINED_SETTER, propertyName, [propertyName.name, staticType], ); diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart index 5821ce0da8b..320d81b9d95 100644 --- a/pkg/analyzer/lib/src/generated/error_verifier.dart +++ b/pkg/analyzer/lib/src/generated/error_verifier.dart @@ -711,7 +711,7 @@ class ErrorVerifier extends RecursiveAstVisitor { node.staticElement == null && !_isFunctionType(expressionType)) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, + CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, functionExpression); } else if (expressionType is FunctionType) { _typeArgumentsVerifier.checkFunctionExpressionInvocation(node); @@ -2241,7 +2241,7 @@ class ErrorVerifier extends RecursiveAstVisitor { if (!_typeSystem.isAssignableTo2(iterableType, requiredSequenceType)) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE, + CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, node.iterable, [iterableType, loopTypeName], ); @@ -2265,7 +2265,7 @@ class ErrorVerifier extends RecursiveAstVisitor { if (!_typeSystem.isAssignableTo2(sequenceElementType, variableType)) { _errorReporter.reportErrorForNode( - StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, + CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, node.iterable, [iterableType, loopTypeName, variableType], ); @@ -2765,7 +2765,7 @@ class ErrorVerifier extends RecursiveAstVisitor { /// Check that the given [typeReference] is not a type reference and that then /// the [name] is reference to an instance member. /// - /// See [StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]. + /// See [CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]. void _checkForInstanceAccessToStaticMember( ClassElement typeReference, Expression target, SimpleIdentifier name) { if (_isInComment) { @@ -2802,7 +2802,7 @@ class ErrorVerifier extends RecursiveAstVisitor { } } _errorReporter.reportErrorForNode( - StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, name, [name.name, _getKind(element), element.enclosingElement.name]); } @@ -2838,7 +2838,7 @@ class ErrorVerifier extends RecursiveAstVisitor { /// Verify that the given left hand side ([lhs]) and right hand side ([rhs]) /// represent a valid assignment. /// - /// See [StaticTypeWarningCode.INVALID_ASSIGNMENT]. + /// See [CompileTimeErrorCode.INVALID_ASSIGNMENT]. void _checkForInvalidAssignment(Expression lhs, Expression rhs) { if (lhs == null || rhs == null) { return; @@ -2863,7 +2863,7 @@ class ErrorVerifier extends RecursiveAstVisitor { } _checkForAssignableExpression( - rhs, leftType, StaticTypeWarningCode.INVALID_ASSIGNMENT); + rhs, leftType, CompileTimeErrorCode.INVALID_ASSIGNMENT); } /// Check the given [initializer] to ensure that the field being initialized @@ -4051,7 +4051,7 @@ class ErrorVerifier extends RecursiveAstVisitor { /// Check that none of the type [parameters] references itself in its bound. /// - /// See [StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND]. + /// See [CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND]. void _checkForTypeParameterBoundRecursion(List parameters) { Map elementToNode; for (var parameter in parameters) { @@ -4074,7 +4074,7 @@ class ErrorVerifier extends RecursiveAstVisitor { if (step == parameters.length) { var element = parameter.declaredElement; _errorReporter.reportErrorForNode( - StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, + CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, parameter, [element.displayName, element.bound], ); @@ -4256,7 +4256,7 @@ class ErrorVerifier extends RecursiveAstVisitor { /// defined in the enclosing class rather than in a superclass. /// /// See - /// [StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]. + /// [CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]. void _checkForUnqualifiedReferenceToNonLocalStaticMember( SimpleIdentifier name) { Element element = name.staticElement; @@ -4289,7 +4289,7 @@ class ErrorVerifier extends RecursiveAstVisitor { [enclosingElement.displayName]); } else { _errorReporter.reportErrorForNode( - StaticTypeWarningCode + CompileTimeErrorCode .UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, name, [enclosingElement.displayName]); diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart index b57f4fe12ee..49cc989b5c5 100644 --- a/pkg/analyzer/lib/src/generated/resolver.dart +++ b/pkg/analyzer/lib/src/generated/resolver.dart @@ -616,7 +616,7 @@ class ResolverVisitor extends ScopedVisitor { node.condition?.accept(this); boolExpressionVerifier.checkForNonBoolExpression( node.condition, - errorCode: StaticTypeWarningCode.NON_BOOL_EXPRESSION, + errorCode: CompileTimeErrorCode.NON_BOOL_EXPRESSION, ); _flowAnalysis?.flow?.assert_afterCondition(node.condition); node.message?.accept(this); @@ -630,7 +630,7 @@ class ResolverVisitor extends ScopedVisitor { node.condition?.accept(this); boolExpressionVerifier.checkForNonBoolExpression( node.condition, - errorCode: StaticTypeWarningCode.NON_BOOL_EXPRESSION, + errorCode: CompileTimeErrorCode.NON_BOOL_EXPRESSION, ); _flowAnalysis?.flow?.assert_afterCondition(node.condition); node.message?.accept(this); diff --git a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart index 0d43ce30232..5c5928d65c0 100644 --- a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart +++ b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart @@ -334,7 +334,7 @@ class A { } var v = const A(); ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 45, 5), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 45, 5), error( CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, 64, @@ -404,7 +404,7 @@ const int y = 1; var v = const C(); ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 27, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 27, 1), error( CheckedModeCompileTimeErrorCode .CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH, @@ -437,7 +437,7 @@ const int y = 1; var v = const C(); ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 27, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 27, 1), ], ); } @@ -620,7 +620,7 @@ const Unresolved x = null; const int x = 'foo'; ''', [ error(CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH, 14, 5), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 14, 5), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 14, 5), ]); } diff --git a/pkg/analyzer/test/generated/compile_time_error_code.dart b/pkg/analyzer/test/generated/compile_time_error_code.dart index 8afcd5b8007..425ac7d7e7d 100644 --- a/pkg/analyzer/test/generated/compile_time_error_code.dart +++ b/pkg/analyzer/test/generated/compile_time_error_code.dart @@ -246,7 +246,7 @@ const int i = (1 ? 'alpha' : 'beta').length; ''', [ error(CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, 14, 29), - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 15, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 15, 1), error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, 15, 1), ]); } diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart index b77cbfd572e..478487e588d 100644 --- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart +++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart @@ -51,7 +51,7 @@ f() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 24, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 24, 1), ]); } @@ -63,7 +63,7 @@ f() { for (i = 0; 3;) {} }''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 12, 1), - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 29, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 29, 1), ]); } diff --git a/pkg/analyzer/test/generated/error_suppression_test.dart b/pkg/analyzer/test/generated/error_suppression_test.dart index 877c7132e2b..233595144fd 100644 --- a/pkg/analyzer/test/generated/error_suppression_test.dart +++ b/pkg/analyzer/test/generated/error_suppression_test.dart @@ -22,7 +22,7 @@ class ErrorSuppressionTest extends DriverResolutionTest with PackageMixin { await assertErrorsInCode(''' int x = ''; // ignore: invalid_assignment ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 8, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 8, 2), ]); } @@ -31,7 +31,7 @@ int x = ''; // ignore: invalid_assignment // ignore: unused_import, undefined_function f() => g(); ''', [ - error(StaticTypeWarningCode.UNDEFINED_FUNCTION, 52, 1), + error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 52, 1), ]); } @@ -41,7 +41,7 @@ f() => g(); int x = ''; int _y = 0; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 34, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 34, 2), error(HintCode.UNUSED_ELEMENT, 42, 2), ]); } @@ -139,7 +139,7 @@ int x = (0 as int); // ignore: UNNECESSARY_CAST int x = ''; const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 43, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 43, 2), error(CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, 57, 1), ]); @@ -153,7 +153,7 @@ const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VA ''', [ error(CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, 43, 1), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 43, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 43, 1), ]); } @@ -162,7 +162,7 @@ const String y = x; //INVALID_ASSIGNMENT, CONST_INITIALIZED_WITH_NON_CONSTANT_VA // ignore invalid_assignment String y = 3; //INVALID_ASSIGNMENT ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 40, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 40, 1), ]); } @@ -228,7 +228,7 @@ int _y = x as int; //UNNECESSARY_CAST, UNUSED_ELEMENT int x = ''; //INVALID_ASSIGNMENT const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 8, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 8, 2), error(CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, 43, 1), ]); @@ -260,7 +260,7 @@ f() => g(); ''' f() => g(); ''', - [error(StaticTypeWarningCode.UNDEFINED_FUNCTION, 7, 1)], + [error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 7, 1)], ); } diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart index 4527bd688c8..286187a8639 100644 --- a/pkg/analyzer/test/generated/non_error_resolver_test.dart +++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart @@ -2181,7 +2181,7 @@ void main() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 93, 1), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 97, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 97, 1), ]); var z = result.unit.declaredElement.topLevelVariables .where((e) => e.name == 'z') @@ -2796,8 +2796,8 @@ main() { null[0]; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 0, 0), - error(StaticTypeWarningCode.UNDEFINED_METHOD, 0, 0), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 0, 0), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 0, 0), ]); } diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart index 61362bfaf79..9423c6ca76b 100644 --- a/pkg/analyzer/test/generated/parser_test.dart +++ b/pkg/analyzer/test/generated/parser_test.dart @@ -6880,7 +6880,7 @@ mixin ExpressionParserTestMixin implements AbstractParserTestCase { InstanceCreationExpressionImpl expression = parseExpression('new a.b.c()', errors: [ expectedError( - StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, 8, 1) ]); @@ -15153,7 +15153,7 @@ main() { } var statement = parseStatement('const A.c();') as ExpressionStatement; assertErrorsWithCodes( - [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR]); + [CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR]); expect(statement.expression, isNotNull); } diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart index 16902a4d53f..bc21731949c 100644 --- a/pkg/analyzer/test/generated/resolver_test.dart +++ b/pkg/analyzer/test/generated/resolver_test.dart @@ -314,7 +314,7 @@ int f(num n) { assert (n is int); return n & 0x0F; }''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 47, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 47, 1), ]); } @@ -337,7 +337,7 @@ int f(num n) { int f(num n) { return (n is! int) ? 0 : n & 0x0F; }''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 44, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 44, 1), ]); } @@ -346,7 +346,7 @@ int f(num n) { int f(num n) { return (n is! int || n < 0) ? 0 : n & 0x0F; }''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 53, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 53, 1), ]); } @@ -373,7 +373,7 @@ int f(List list) { }''', [ error(HintCode.MISSING_RETURN, 4, 1), error(HintCode.UNUSED_LOCAL_VARIABLE, 30, 3), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 76, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 76, 1), ]); } @@ -406,7 +406,7 @@ int f(num n) { return n & 0x0F; } }''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 72, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 72, 1), ]); } @@ -418,7 +418,7 @@ int f(num n) { } return n & 0x0F; }''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 63, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 63, 1), ]); } @@ -431,7 +431,7 @@ int f(num n) { return n & 0x0F; } }''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 81, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 81, 1), ]); } @@ -441,7 +441,7 @@ int f() { num n = 1234; return n & 0x0F; }''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 37, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 37, 1), ]); } } diff --git a/pkg/analyzer/test/generated/simple_resolver_test.dart b/pkg/analyzer/test/generated/simple_resolver_test.dart index 4ff5151a3f3..09bb7307293 100644 --- a/pkg/analyzer/test/generated/simple_resolver_test.dart +++ b/pkg/analyzer/test/generated/simple_resolver_test.dart @@ -786,7 +786,7 @@ f() { List> b; b[0][0] = 'hi'; }''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 39, 4), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 39, 4), ]); verifyTestResolved(); } diff --git a/pkg/analyzer/test/generated/static_type_warning_code_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_test.dart index d0ad450f6f7..14674c4651f 100644 --- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart +++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart @@ -34,7 +34,7 @@ f(Object x) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 65, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 65, 3), ]); } @@ -59,7 +59,7 @@ f() async { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 68, 1), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 72, 10), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 72, 10), ]); } @@ -84,7 +84,7 @@ f() async { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 75, 1), - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 80, 6), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 80, 6), ]); } @@ -135,7 +135,7 @@ f() async { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 64, 1), - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 85, 6), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 85, 6), ]); } @@ -185,8 +185,8 @@ void main() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 271, 4), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 289, 2), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 304, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 289, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 304, 2), ]); } @@ -207,7 +207,7 @@ f() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 22, 10), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 22, 10), ]); } @@ -272,7 +272,7 @@ f() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 12, 1), - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 27, 10), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 27, 10), ]); } @@ -306,7 +306,7 @@ class Foo> { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 81, 1), - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 86, 8), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 86, 8), ]); } @@ -344,7 +344,7 @@ main(Object p) { p = 0; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 71, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 71, 6), ]); } @@ -354,7 +354,7 @@ main(Object p) { ((p is String) && ((p = 42) == 42)) && p.length != 0; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 60, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 60, 6), ]); } @@ -364,7 +364,7 @@ main(Object p) { (p is String) && (((p = 42) == 42) && p.length != 0); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 59, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 59, 6), ]); } @@ -376,7 +376,7 @@ main(Object p) { p = 42; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 68, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 68, 6), ]); } @@ -388,7 +388,7 @@ main(Object p) { p is String ? callMe(() { p.length; }) : 0; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 78, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 78, 6), ]); } @@ -398,7 +398,7 @@ main(Object p) { p is String ? (p.length + (p = 42)) : 0; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 36, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 36, 6), ]); } @@ -414,7 +414,7 @@ main(Object p) { p = 0; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 83, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 83, 6), ]); } @@ -426,7 +426,7 @@ main(Object p) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 66, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 66, 6), ]); } @@ -444,7 +444,7 @@ main(A p) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 100, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 100, 1), ]); } @@ -462,7 +462,7 @@ main(A p) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 105, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 105, 1), ]); } @@ -475,7 +475,7 @@ main(Object p) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 44, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 44, 6), ]); } @@ -488,7 +488,7 @@ main(Object p) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 55, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 55, 6), ]); } @@ -501,7 +501,7 @@ main(Object p) { () {p = 0;}; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 44, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 44, 6), ]); } @@ -514,7 +514,7 @@ main(Object p) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 59, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 59, 6), ]); } @@ -527,7 +527,7 @@ main(Object p) { f() {p = 0;}; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 44, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 44, 6), error(HintCode.UNUSED_ELEMENT, 58, 1), ]); } @@ -542,7 +542,7 @@ main(Object p) { } ''', [ error(HintCode.UNUSED_ELEMENT, 19, 1), - error(StaticTypeWarningCode.UNDEFINED_GETTER, 60, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 60, 6), ]); } @@ -560,7 +560,7 @@ main(A p) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 103, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 103, 1), ]); } @@ -578,7 +578,7 @@ main(A p) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 112, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 112, 1), ]); } @@ -591,7 +591,7 @@ main(A a) { a.element.anyGetterExistsInDynamic; } ''', [ - error(StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT, 35, 10), + error(CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, 35, 10), ]); } } diff --git a/pkg/analyzer/test/generated/strong_mode_test.dart b/pkg/analyzer/test/generated/strong_mode_test.dart index 6504efa4084..efa2a44b227 100644 --- a/pkg/analyzer/test/generated/strong_mode_test.dart +++ b/pkg/analyzer/test/generated/strong_mode_test.dart @@ -912,7 +912,7 @@ class StrongModeLocalInferenceTest extends ResolverTestCase { // Test that FutureOr does not have the constituent type methods MethodInvocation invoke = await _testFutureOr(r''' dynamic test(FutureOr x) => x.abs(); - ''', errors: [StaticTypeWarningCode.UNDEFINED_METHOD]); + ''', errors: [CompileTimeErrorCode.UNDEFINED_METHOD]); _isDynamic(invoke.staticType); } @@ -920,7 +920,7 @@ class StrongModeLocalInferenceTest extends ResolverTestCase { // Test that FutureOr does not have the Future type methods MethodInvocation invoke = await _testFutureOr(r''' dynamic test(FutureOr x) => x.then((x) => x); - ''', errors: [StaticTypeWarningCode.UNDEFINED_METHOD]); + ''', errors: [CompileTimeErrorCode.UNDEFINED_METHOD]); _isDynamic(invoke.staticType); } @@ -928,7 +928,7 @@ class StrongModeLocalInferenceTest extends ResolverTestCase { // Test that FutureOr does not have all methods MethodInvocation invoke = await _testFutureOr(r''' dynamic test(FutureOr x) => x.abs(); - ''', errors: [StaticTypeWarningCode.UNDEFINED_METHOD]); + ''', errors: [CompileTimeErrorCode.UNDEFINED_METHOD]); _isDynamic(invoke.staticType); } @@ -3667,7 +3667,7 @@ void main() { test_returnOfInvalidType_object_void() async { await assertErrorsInCode( "Object f() { void voidFn() => null; return voidFn(); }", [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 43, 8), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 43, 8), ]); } @@ -3702,7 +3702,7 @@ class A { } set g(int x) => 42; ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 41, 4), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 41, 4), ]); } diff --git a/pkg/analyzer/test/source/error_processor_test.dart b/pkg/analyzer/test/source/error_processor_test.dart index f3e548d004f..2a58d77bb25 100644 --- a/pkg/analyzer/test/source/error_processor_test.dart +++ b/pkg/analyzer/test/source/error_processor_test.dart @@ -19,7 +19,7 @@ import '../src/util/yaml_test.dart'; main() { AnalysisError invalid_assignment = AnalysisError( - TestSource(), 0, 1, StaticTypeWarningCode.INVALID_ASSIGNMENT, [ + TestSource(), 0, 1, CompileTimeErrorCode.INVALID_ASSIGNMENT, [ ['x'], ['y'] ]); diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart index 031f9e31403..2f46907c073 100644 --- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart +++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart @@ -1666,7 +1666,7 @@ String z = "string"; ResolvedUnitResult result = await driver.getResult(b); List errors = result.errors; expect(errors, hasLength(1)); - expect(errors[0].errorCode, StaticTypeWarningCode.INVALID_ASSIGNMENT); + expect(errors[0].errorCode, CompileTimeErrorCode.INVALID_ASSIGNMENT); } } diff --git a/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart b/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart index 00533932705..eb8b1081ae4 100644 --- a/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart +++ b/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart @@ -152,7 +152,7 @@ analyzer: num a = 0; int b = a; ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 19, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 19, 1), ]); } @@ -167,7 +167,7 @@ analyzer: num a = 0; int b = a; ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 19, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 19, 1), ]); } @@ -184,7 +184,7 @@ analyzer: num a = 0; int b = a; ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 19, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 19, 1), ]); } @@ -383,7 +383,7 @@ analyzer: num a = 0; int b = a; ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 19, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 19, 1), ]); // Implicit casts are enabled in 'bbb'. @@ -398,7 +398,7 @@ int b = a; num a = 0; int b = a; ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 19, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 19, 1), ]); } diff --git a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart index 531f4b16ba7..4b8a3975329 100644 --- a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart @@ -153,10 +153,10 @@ main(int i) { i %= 1.2; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 21, 3), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 33, 3), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 45, 3), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 57, 3), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 21, 3), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 33, 3), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 45, 3), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 57, 3), ]); assertType(findNode.assignment('+='), 'double'); assertType(findNode.assignment('-='), 'double'); @@ -187,7 +187,7 @@ main(double a, int b) { a ??= b; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 32, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 32, 1), ]); assertType(findNode.assignment('??='), 'num'); } diff --git a/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart b/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart index d8216d2ac0b..9bb15816a0f 100644 --- a/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart @@ -138,7 +138,7 @@ f() { prefix.A.named(0); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, 50, 5), ]); @@ -220,7 +220,7 @@ f() { A.named(0); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, 52, 13), ]); diff --git a/pkg/analyzer/test/src/dart/resolution/class_test.dart b/pkg/analyzer/test/src/dart/resolution/class_test.dart index 891e684364b..3b4f1a2d0e1 100644 --- a/pkg/analyzer/test/src/dart/resolution/class_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/class_test.dart @@ -681,7 +681,7 @@ class B extends A { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SUPER_GETTER, 58, 1), + error(CompileTimeErrorCode.UNDEFINED_SUPER_GETTER, 58, 1), ]); } @@ -694,7 +694,7 @@ class B extends A { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, 56, 1), + error(CompileTimeErrorCode.UNDEFINED_SUPER_METHOD, 56, 1), ]); } @@ -707,7 +707,7 @@ class B extends A { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, 70, 1), + error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 70, 1), ]); } @@ -720,8 +720,8 @@ class B extends A { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, 70, 7), - error(StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, 70, 7), + error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 70, 7), + error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 70, 7), ]); } @@ -734,7 +734,7 @@ class B extends A { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, 70, 11), + error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 70, 11), ]); } @@ -747,7 +747,7 @@ class B extends A { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, 71, 7), + error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 71, 7), ]); } @@ -760,7 +760,7 @@ class B extends A { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SUPER_SETTER, 49, 1), + error(CompileTimeErrorCode.UNDEFINED_SUPER_SETTER, 49, 1), ]); } } diff --git a/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart b/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart index 191d6c2ae8e..b4414b368aa 100644 --- a/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart @@ -149,7 +149,7 @@ f(C c) { c.a; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 40, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 40, 1), ]); } @@ -167,7 +167,7 @@ f(C c) { c.a; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 40, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 40, 1), ]); } diff --git a/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart b/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart index 1ae8a7d7eb2..35e383a3049 100644 --- a/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart @@ -122,7 +122,7 @@ void f() { ''', [ error(ParserErrorCode.INVALID_GENERIC_FUNCTION_TYPE, 13, 1), error(ParserErrorCode.EXPECTED_TYPE_NAME, 15, 1), - error(StaticTypeWarningCode.UNDEFINED_GETTER, 33, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 33, 1), ]); } @@ -137,7 +137,7 @@ void f() { p.F.a; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 40, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 40, 1), ]); } diff --git a/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart b/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart index 509155901b8..85e42d9bd16 100644 --- a/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart @@ -19,7 +19,7 @@ class InstanceCreationDriverResolutionTest extends DriverResolutionTest { await assertErrorsInCode(r''' final foo = Map(); ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 12, 8), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 12, 8), ]); var creation = findNode.instanceCreation('Map'); @@ -42,7 +42,7 @@ main() { new Foo.bar(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, 53, 5), ]); @@ -70,7 +70,7 @@ main() { new p.Foo.bar(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, 44, 3), ]); @@ -97,7 +97,7 @@ main() { Foo.bar(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, 49, 5), ]); @@ -129,7 +129,7 @@ main() { p.Foo.bar(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, 43, 5), ]); diff --git a/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart b/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart index 35c029ee015..513338a4da5 100644 --- a/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart @@ -78,7 +78,7 @@ main(A a) { a.foo(0); } ''', [ - error(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 57, 3), + error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 57, 3), ]); assertMethodInvocation2( findNode.methodInvocation('a.foo(0)'), @@ -99,7 +99,7 @@ main(C c) { c(); } ''', [ - error(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 51, 1), + error(CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 51, 1), ]); var invocation = findNode.functionExpressionInvocation('c();'); @@ -119,7 +119,7 @@ main() { foo(); } ''', [ - error(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 25, 3), + error(CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 25, 3), ]); var invocation = findNode.functionExpressionInvocation('foo();'); @@ -265,7 +265,7 @@ main() { C.foo(); } ''', [ - error(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 42, 5), + error(CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 42, 5), ]); var invocation = findNode.functionExpressionInvocation('foo();'); @@ -289,7 +289,7 @@ class C { } } ''', [ - error(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 46, 3), + error(CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 46, 3), ]); var invocation = findNode.functionExpressionInvocation('foo();'); @@ -314,7 +314,7 @@ class B extends A { } } ''', [ - error(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 68, 9), + error(CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 68, 9), ]); var invocation = findNode.functionExpressionInvocation('foo();'); @@ -401,7 +401,7 @@ main() { foo(0); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_FUNCTION, 11, 3), + error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 11, 3), ]); _assertUnresolvedMethodInvocation('foo(0)'); } @@ -414,7 +414,7 @@ main() { math.foo(0); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_FUNCTION, 45, 3), + error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 45, 3), ]); _assertUnresolvedMethodInvocation('foo(0);'); } @@ -437,7 +437,7 @@ main() { C.foo(0); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 24, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 24, 3), ]); _assertUnresolvedMethodInvocation('foo(0);'); } @@ -451,7 +451,7 @@ main() { C.foo(x); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 32, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 32, 3), ]); _assertUnresolvedMethodInvocation('foo(x);'); @@ -470,7 +470,7 @@ main() { C.foo(0); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 76, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 76, 3), ]); _assertUnresolvedMethodInvocation('foo(0);'); } @@ -483,7 +483,7 @@ main() { C.foo(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 25, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 25, 3), ]); _assertUnresolvedMethodInvocation( @@ -499,7 +499,7 @@ class C { static main() => C.T(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 34, 1), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 34, 1), ]); _assertUnresolvedMethodInvocation('C.T();'); } @@ -510,7 +510,7 @@ main() { 42.foo(0); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 14, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 14, 3), ]); _assertUnresolvedMethodInvocation('foo(0);'); } @@ -522,7 +522,7 @@ main() { v.foo(0); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 30, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 30, 3), ]); _assertUnresolvedMethodInvocation('foo(0);'); } @@ -535,7 +535,7 @@ class C { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 25, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 25, 3), ]); _assertUnresolvedMethodInvocation('foo(0);'); } @@ -546,7 +546,7 @@ main() { null.foo(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 16, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 16, 3), ]); _assertUnresolvedMethodInvocation('foo();'); } @@ -557,7 +557,7 @@ main(Object o) { o.call(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 21, 4), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 21, 4), ]); } @@ -576,7 +576,7 @@ class B extends A { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 53, 4), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 53, 4), ]); _assertUnresolvedMethodInvocation('_foo(0);'); } @@ -591,7 +591,7 @@ main() { C..foo(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 50, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 50, 3), ]); } @@ -604,7 +604,7 @@ main() { A?.toString(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 25, 8), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 25, 8), ]); } @@ -618,7 +618,7 @@ class B extends A { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, 62, 3), + error(CompileTimeErrorCode.UNDEFINED_SUPER_METHOD, 62, 3), ]); _assertUnresolvedMethodInvocation('foo(0);'); assertSuperExpression(findNode.super_('super.foo')); @@ -637,7 +637,7 @@ class B extends A { } ''', [ error( - StaticTypeWarningCode + CompileTimeErrorCode .UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, 71, 3), @@ -830,7 +830,7 @@ main() { foo(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, 29, 5), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, 29, 5), ]); assertMethodInvocation( findNode.methodInvocation('foo()'), @@ -848,7 +848,7 @@ main() { foo(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, 58, 5), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, 58, 5), ]); assertMethodInvocation( findNode.methodInvocation('foo()'), @@ -1655,7 +1655,7 @@ main() { } ''', [ error( - StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, 32, 13), + CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, 32, 13), ]); var invocation = findNode.methodInvocation('foo();'); assertTypeArgumentTypes(invocation, ['dynamic']); @@ -1914,7 +1914,7 @@ main(A? a) { } ''', [ error(CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE, 27, 1), - error(StaticTypeWarningCode.UNDEFINED_METHOD, 29, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 29, 3), ]); assertMethodInvocation2( @@ -1939,7 +1939,7 @@ main(A? a) { } ''', [ error(CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE, 65, 1), - error(StaticTypeWarningCode.UNDEFINED_METHOD, 67, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 67, 3), ]); assertMethodInvocation2( diff --git a/pkg/analyzer/test/src/dart/resolution/mixin_test.dart b/pkg/analyzer/test/src/dart/resolution/mixin_test.dart index 3732016a170..5fcc5b5d739 100644 --- a/pkg/analyzer/test/src/dart/resolution/mixin_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/mixin_test.dart @@ -958,7 +958,7 @@ mixin M on A { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, 52, 3), + error(CompileTimeErrorCode.UNDEFINED_SUPER_METHOD, 52, 3), ]); var invocation = findNode.methodInvocation('foo(42)'); diff --git a/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart index 14dd4c2f36f..d32b3cb7c51 100644 --- a/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart @@ -64,7 +64,7 @@ f(int x) { !x; } ''', [ - error(StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION, 14, 1), + error(CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, 14, 1), ]); assertPrefixExpression( diff --git a/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart b/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart index 4288df4617f..9222211156a 100644 --- a/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart @@ -102,7 +102,7 @@ int Function() foo() { return a; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 50, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 50, 1), ]); var identifier = findNode.simple('a;'); diff --git a/pkg/analyzer/test/src/dart/resolution/property_access_test.dart b/pkg/analyzer/test/src/dart/resolution/property_access_test.dart index 1c626bd2921..b57b14ef6b2 100644 --- a/pkg/analyzer/test/src/dart/resolution/property_access_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/property_access_test.dart @@ -51,7 +51,7 @@ int Function() foo() { return B().a; // ref } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 85, 5), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 85, 5), ]); var identifier = findNode.simple('a; // ref'); diff --git a/pkg/analyzer/test/src/dart/resolution/simple_identifier_test.dart b/pkg/analyzer/test/src/dart/resolution/simple_identifier_test.dart index c62baebfe87..732f7b18e18 100644 --- a/pkg/analyzer/test/src/dart/resolution/simple_identifier_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/simple_identifier_test.dart @@ -151,7 +151,7 @@ int Function() foo(A? a) { return a; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 68, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 68, 1), ]); var identifier = findNode.simple('a;'); diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart index 031d921ba12..84ca28f76c8 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart @@ -20,7 +20,7 @@ class FunctionExpressionTest extends DriverResolutionTest { test_contextFunctionType_returnType_async_blockBody_futureOrVoid() async { var expectedErrors = expectedErrorsByNullability( nullable: [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 72, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 72, 1), ], legacy: [], ); @@ -43,7 +43,7 @@ FutureOr Function() v = () async { test_contextFunctionType_returnType_async_blockBody_futureVoid() async { var expectedErrors = expectedErrorsByNullability( nullable: [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 48, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 48, 1), ], legacy: [], ); @@ -164,7 +164,7 @@ int Function() v = () { test_contextFunctionType_returnType_sync_blockBody_void() async { var expectedErrors = expectedErrorsByNullability(nullable: [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 34, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 34, 1), ], legacy: []); await assertErrorsInCode(''' void Function() v = () { diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/list_literal_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/list_literal_test.dart index 32c358a5401..53970afdf71 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/list_literal_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/list_literal_test.dart @@ -43,7 +43,7 @@ List a = []; test_context_noTypeArgs_noElements_typeParameter() async { var expectedErrors = expectedErrorsByNullability( nullable: [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 39, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 39, 2), ], legacy: [ error(CompileTimeErrorCode.INVALID_CAST_LITERAL_LIST, 39, 2), @@ -60,7 +60,7 @@ class A> { test_context_noTypeArgs_noElements_typeParameter_dynamic() async { var expectedErrors = expectedErrorsByNullability( nullable: [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 43, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 43, 2), ], legacy: [ error(CompileTimeErrorCode.INVALID_CAST_LITERAL_LIST, 43, 2), @@ -78,7 +78,7 @@ class A> { await assertErrorsInCode(''' List a = [0]; ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 17, 8), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 17, 8), ]); assertType(findNode.listLiteral('['), 'List'); } @@ -113,7 +113,7 @@ List a = ['a']; await assertErrorsInCode(''' List a = []; ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 17, 7), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 17, 7), ]); assertType(findNode.listLiteral('['), 'List'); } diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/map_literal_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/map_literal_test.dart index c387ddf3e25..54c5c981658 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/map_literal_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/map_literal_test.dart @@ -66,7 +66,7 @@ Map a = {}; test_context_noTypeArgs_noEntries_typeParameters() async { var expectedErrors = expectedErrorsByNullability( nullable: [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 46, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 46, 2), ], legacy: [ error(CompileTimeErrorCode.INVALID_CAST_LITERAL_MAP, 46, 2), @@ -83,7 +83,7 @@ class A> { test_context_noTypeArgs_noEntries_typeParameters_dynamic() async { var expectedErrors = expectedErrorsByNullability( nullable: [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 51, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 51, 2), ], legacy: [ error(CompileTimeErrorCode.INVALID_CAST_LITERAL_MAP, 51, 2), @@ -126,7 +126,7 @@ Map a = {'a' : 'b'}; await assertErrorsInCode(''' Map a = {}; ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 24, 12), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 24, 12), ]); assertType(setOrMapLiteral('{'), 'Map'); } diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/set_literal_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/set_literal_test.dart index 9a25ca0d5f1..267717e83da 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/set_literal_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/set_literal_test.dart @@ -57,7 +57,7 @@ FutureOr> f() { test_context_noTypeArgs_noElements_typeParameter() async { var expectedErrors = expectedErrorsByNullability( nullable: [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 38, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 38, 2), ], legacy: [ error(CompileTimeErrorCode.INVALID_CAST_LITERAL_SET, 38, 2), @@ -74,7 +74,7 @@ class A> { test_context_noTypeArgs_noElements_typeParameter_dynamic() async { var expectedErrors = expectedErrorsByNullability( nullable: [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 42, 2), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 42, 2), ], legacy: [ error(CompileTimeErrorCode.INVALID_CAST_LITERAL_SET, 42, 2), @@ -116,7 +116,7 @@ Set a = {'a'}; await assertErrorsInCode(''' Set a = {}; ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 16, 7), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 16, 7), ]); assertType(setLiteral('{'), 'Set'); } diff --git a/pkg/analyzer/test/src/diagnostics/ambiguous_extension_member_access_test.dart b/pkg/analyzer/test/src/diagnostics/ambiguous_extension_member_access_test.dart index dc9635c6e8e..a27736a57e2 100644 --- a/pkg/analyzer/test/src/diagnostics/ambiguous_extension_member_access_test.dart +++ b/pkg/analyzer/test/src/diagnostics/ambiguous_extension_member_access_test.dart @@ -31,7 +31,7 @@ int f(A a) => a(); ''', [ error(CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS, 110, 1), error( - StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 110, 1), + CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 110, 1), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/assignment_to_method_test.dart b/pkg/analyzer/test/src/diagnostics/assignment_to_method_test.dart index 3361f2379fb..ad89ea1bf36 100644 --- a/pkg/analyzer/test/src/diagnostics/assignment_to_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/assignment_to_method_test.dart @@ -30,7 +30,7 @@ f(C c) { } ''', [ error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 87, 5), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 95, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 95, 1), ]); } @@ -61,7 +61,7 @@ extension E on C { } ''', [ error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 86, 8), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 97, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 97, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_test.dart index 711122d1096..085d6eec3c7 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_test.dart @@ -20,7 +20,7 @@ class ConstEvalTypeBoolTest extends DriverResolutionTest { const c = true && ''; ''', [ error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, 10, 10), - error(StaticTypeWarningCode.NON_BOOL_OPERAND, 18, 2), + error(CompileTimeErrorCode.NON_BOOL_OPERAND, 18, 2), ]); } @@ -29,7 +29,7 @@ const c = true && ''; const c = (true || 0); ''', [ error(HintCode.DEAD_CODE, 19, 1), - error(StaticTypeWarningCode.NON_BOOL_OPERAND, 19, 1), + error(CompileTimeErrorCode.NON_BOOL_OPERAND, 19, 1), ]); } @@ -38,7 +38,7 @@ const c = (true || 0); const c = false || ''; ''', [ error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, 10, 11), - error(StaticTypeWarningCode.NON_BOOL_OPERAND, 19, 2), + error(CompileTimeErrorCode.NON_BOOL_OPERAND, 19, 2), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/expected_one_list_type_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/expected_one_list_type_arguments_test.dart index c5b3597820d..c478806b20c 100644 --- a/pkg/analyzer/test/src/diagnostics/expected_one_list_type_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/expected_one_list_type_arguments_test.dart @@ -28,7 +28,7 @@ main() { main() { []; }''', [ - error(StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS, 11, 10), + error(CompileTimeErrorCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS, 11, 10), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/expected_one_set_type_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/expected_one_set_type_arguments_test.dart index 890ca88262a..2192c2b3b7d 100644 --- a/pkg/analyzer/test/src/diagnostics/expected_one_set_type_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/expected_one_set_type_arguments_test.dart @@ -20,7 +20,7 @@ class ExpectedOneSetTypeArgumentsTest extends DriverResolutionTest { main() { {2, 3}; }''', [ - error(StaticTypeWarningCode.EXPECTED_ONE_SET_TYPE_ARGUMENTS, 11, 15), + error(CompileTimeErrorCode.EXPECTED_ONE_SET_TYPE_ARGUMENTS, 11, 15), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/expected_two_map_type_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/expected_two_map_type_arguments_test.dart index a8b297f5e49..5c1a8404fa0 100644 --- a/pkg/analyzer/test/src/diagnostics/expected_two_map_type_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/expected_two_map_type_arguments_test.dart @@ -22,7 +22,7 @@ class ExpectedTwoMapTypeArgumentsTest extends DriverResolutionTest { main() { {}; }''', [ - error(StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, 11, 15), + error(CompileTimeErrorCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, 11, 15), ]); } @@ -31,7 +31,7 @@ main() { main() { {1: 2}; }''', [ - error(StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, 11, 15), + error(CompileTimeErrorCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, 11, 15), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_element_type_test.dart b/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_element_type_test.dart index eb1ddf720fe..8824a62e86d 100644 --- a/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_element_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_element_type_test.dart @@ -24,7 +24,7 @@ f() async { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 75, 1), - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 80, 6), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 80, 6), ]); } @@ -38,7 +38,7 @@ f() async { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 64, 1), - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 85, 6), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 85, 6), ]); } @@ -51,7 +51,7 @@ class Foo> { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 81, 1), - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 86, 8), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 86, 8), ]); } @@ -62,7 +62,7 @@ f() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 22, 10), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 22, 10), ]); } @@ -74,7 +74,7 @@ f() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 12, 1), - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 27, 10), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 27, 10), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_type_test.dart b/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_type_test.dart index a07d16bc758..00e6a70ae75 100644 --- a/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_type_test.dart @@ -35,7 +35,7 @@ f(bool e) async { } } ''', [ - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE, 41, 1), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 41, 1), ]); } @@ -57,7 +57,7 @@ f(bool e) { } } ''', [ - error(StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE, 29, 1), + error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 29, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/illegal_async_return_type_test.dart b/pkg/analyzer/test/src/diagnostics/illegal_async_return_type_test.dart index a5d8ce950af..55ed10e92b7 100644 --- a/pkg/analyzer/test/src/diagnostics/illegal_async_return_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/illegal_async_return_type_test.dart @@ -19,7 +19,7 @@ class IllegalAsyncReturnTypeTest extends DriverResolutionTest { await assertErrorsInCode(''' int f() async {} ''', [ - error(StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE, 0, 3), + error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 0, 3), ]); } @@ -35,7 +35,7 @@ int f() async { return 2; } ''', [ - error(StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE, 0, 3), + error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 0, 3), ]); } @@ -47,7 +47,7 @@ SubFuture f() async { return 0; } ''', [ - error(StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE, 73, 14), + error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 73, 14), ]); } @@ -57,7 +57,7 @@ class C { int m() async {} } ''', [ - error(StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE, 12, 3), + error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 12, 3), ]); } @@ -79,7 +79,7 @@ class C { } } ''', [ - error(StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE, 85, 14), + error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 85, 14), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/instance_access_to_static_member_test.dart b/pkg/analyzer/test/src/diagnostics/instance_access_to_static_member_test.dart index a409b21eadb..6eb6bef9538 100644 --- a/pkg/analyzer/test/src/diagnostics/instance_access_to_static_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/instance_access_to_static_member_test.dart @@ -28,7 +28,7 @@ f(C c) { g(c).a; } ''', [ - error(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 93, 1), + error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 93, 1), ]); assertElement( findNode.simple('a;'), @@ -48,7 +48,7 @@ f(C c) { c.a(); } ''', [ - error(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 68, 1), + error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 68, 1), ]); assertElement( findNode.methodInvocation('a();'), @@ -68,7 +68,7 @@ f(C c) { c.a = 2; } ''', [ - error(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 68, 1), + error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 68, 1), ]); assertElement( findNode.simple('a = 2;'), @@ -85,7 +85,7 @@ main(A a) { a.m; } ''', [ - error(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 44, 1), + error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 44, 1), ]); } @@ -98,7 +98,7 @@ main(A a) { a.f; } ''', [ - error(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 44, 1), + error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 44, 1), ]); } @@ -111,7 +111,7 @@ main(A a) { a.f; } ''', [ - error(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 50, 1), + error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 50, 1), ]); } @@ -124,7 +124,7 @@ main(A a) { a.f = 42; } ''', [ - error(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 49, 1), + error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 49, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart index 348b42222af..277a933df72 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart @@ -26,7 +26,7 @@ void f(int i) { d ??= i; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 37, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 37, 1), ]); } @@ -59,7 +59,7 @@ void f(Never x) { } ''', [ error(HintCode.DEAD_CODE, 24, 5), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 24, 4), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 24, 4), ]); } @@ -72,7 +72,7 @@ void f() { } ''', [ error(HintCode.DEAD_CODE, 37, 5), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 37, 4), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 37, 4), ]); } @@ -88,7 +88,7 @@ class B { } } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 58, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 58, 1), ]); } } @@ -129,7 +129,7 @@ void main() { f({String x: 0}) { } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 13, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 13, 1), ]); } @@ -143,7 +143,7 @@ f({String x: '0'}) { await assertErrorsInCode(r''' f([String x = 0]) { }''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 14, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 14, 1), ]); } @@ -160,7 +160,7 @@ main() { dynamic = 1; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 21, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 21, 1), ]); } @@ -170,7 +170,7 @@ class C { String x = (() => 5)(); } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 23, 11), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 23, 11), ]); } @@ -181,7 +181,7 @@ void f(int i) { d ??= i; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 36, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 36, 1), ]); } @@ -292,7 +292,7 @@ f(var y) { } } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 80, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 80, 1), ]); } @@ -316,7 +316,7 @@ f() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 12, 1), - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 21, 3), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 21, 3), ]); } @@ -329,7 +329,7 @@ f(var y) { } } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 44, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 44, 1), ]); } @@ -345,7 +345,7 @@ f(A a) { a++; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 65, 3), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 65, 3), ]); } @@ -377,7 +377,7 @@ f(C c) { c.a++; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 91, 5), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 91, 5), ]); } @@ -409,7 +409,7 @@ f(A a) { ++a; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 65, 3), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 65, 3), ]); } @@ -441,7 +441,7 @@ f(C c) { ++c.a; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 91, 5), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 91, 5), ]); } @@ -491,7 +491,7 @@ class C { T t = int; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 21, 3), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 21, 3), ]); } @@ -504,7 +504,7 @@ f() { A.x = '0'; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 46, 3), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 46, 3), ]); } @@ -519,7 +519,7 @@ f(var y) { } } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 74, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 74, 1), ]); } @@ -527,7 +527,7 @@ f(var y) { await assertErrorsInCode(''' int x = 'string'; ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 8, 8), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 8, 8), ]); } @@ -541,7 +541,7 @@ class B { } } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 57, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 57, 1), ]); } @@ -559,7 +559,7 @@ void f(X x) { } } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 131, 1), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 131, 1), ]); } @@ -569,7 +569,7 @@ class A { int x = 'string'; } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 20, 8), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 20, 8), ]); } @@ -590,7 +590,7 @@ main() { print(n); } ''', [ - error(StaticTypeWarningCode.INVALID_ASSIGNMENT, 218, 7), + error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 218, 7), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/invocation_of_non_function_expression_test.dart b/pkg/analyzer/test/src/diagnostics/invocation_of_non_function_expression_test.dart index 0554340cbca..9435340dccb 100644 --- a/pkg/analyzer/test/src/diagnostics/invocation_of_non_function_expression_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invocation_of_non_function_expression_test.dart @@ -21,7 +21,7 @@ f() { 3(5); } ''', [ - error(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 8, 1), + error(CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 8, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_bool_condition_test.dart b/pkg/analyzer/test/src/diagnostics/non_bool_condition_test.dart index 02438ae5980..2ee87259c81 100644 --- a/pkg/analyzer/test/src/diagnostics/non_bool_condition_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_bool_condition_test.dart @@ -21,7 +21,7 @@ class NonBoolConditionTest extends DriverResolutionTest { await assertErrorsInCode(''' f() { return 3 ? 2 : 1; } ''', [ - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 13, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 13, 1), ]); } @@ -31,7 +31,7 @@ f() { do {} while (3); } ''', [ - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 21, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 21, 1), ]); } @@ -42,7 +42,7 @@ f() { for (;3;) {} } ''', [ - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 14, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 14, 1), ]); } @@ -50,7 +50,7 @@ f() { await assertErrorsInCode(''' var v = [for (; 0;) 1]; ''', [ - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 16, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 16, 1), ]); } @@ -60,7 +60,7 @@ f() { if (3) return 2; else return 1; } ''', [ - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 12, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 12, 1), ]); } @@ -68,7 +68,7 @@ f() { await assertErrorsInCode(''' var v = [if (3) 1]; ''', [ - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 13, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 13, 1), ]); } @@ -78,7 +78,7 @@ f() { while (3) {} } ''', [ - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 15, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 15, 1), ]); } } @@ -93,7 +93,7 @@ m() { if (x) {} } ''', [ - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 22, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 22, 1), ]); } @@ -104,7 +104,7 @@ m() { x ? 0 : 1; } ''', [ - error(StaticTypeWarningCode.NON_BOOL_CONDITION, 18, 1), + error(CompileTimeErrorCode.NON_BOOL_CONDITION, 18, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_bool_expression_test.dart b/pkg/analyzer/test/src/diagnostics/non_bool_expression_test.dart index 258accbe7ed..61535c7a923 100644 --- a/pkg/analyzer/test/src/diagnostics/non_bool_expression_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_bool_expression_test.dart @@ -22,7 +22,7 @@ f() { assert(makeAssertion); } ''', [ - error(StaticTypeWarningCode.NON_BOOL_EXPRESSION, 45, 13), + error(CompileTimeErrorCode.NON_BOOL_EXPRESSION, 45, 13), ]); } @@ -33,7 +33,7 @@ f() { assert(makeAssertion); } ''', [ - error(StaticTypeWarningCode.NON_BOOL_EXPRESSION, 41, 13), + error(CompileTimeErrorCode.NON_BOOL_EXPRESSION, 41, 13), ]); } @@ -43,7 +43,7 @@ f() { assert(0); } ''', [ - error(StaticTypeWarningCode.NON_BOOL_EXPRESSION, 15, 1), + error(CompileTimeErrorCode.NON_BOOL_EXPRESSION, 15, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_bool_negation_expression_test.dart b/pkg/analyzer/test/src/diagnostics/non_bool_negation_expression_test.dart index 7eb4c529d4d..f0c4ff3e266 100644 --- a/pkg/analyzer/test/src/diagnostics/non_bool_negation_expression_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_bool_negation_expression_test.dart @@ -23,7 +23,7 @@ f() { !42; } ''', [ - error(StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION, 9, 2), + error(CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, 9, 2), ]); } } @@ -39,7 +39,7 @@ m() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION, 19, 1), + error(CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, 19, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_bool_operand_test.dart b/pkg/analyzer/test/src/diagnostics/non_bool_operand_test.dart index 07c6c1dff52..f3496efdcd7 100644 --- a/pkg/analyzer/test/src/diagnostics/non_bool_operand_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_bool_operand_test.dart @@ -23,7 +23,7 @@ bool f(int left, bool right) { return left && right; } ''', [ - error(StaticTypeWarningCode.NON_BOOL_OPERAND, 40, 4), + error(CompileTimeErrorCode.NON_BOOL_OPERAND, 40, 4), ]); } @@ -33,7 +33,7 @@ bool f(bool left, String right) { return left && right; } ''', [ - error(StaticTypeWarningCode.NON_BOOL_OPERAND, 51, 5), + error(CompileTimeErrorCode.NON_BOOL_OPERAND, 51, 5), ]); } @@ -43,7 +43,7 @@ bool f(List left, bool right) { return left || right; } ''', [ - error(StaticTypeWarningCode.NON_BOOL_OPERAND, 46, 4), + error(CompileTimeErrorCode.NON_BOOL_OPERAND, 46, 4), ]); } @@ -53,7 +53,7 @@ bool f(bool left, double right) { return left || right; } ''', [ - error(StaticTypeWarningCode.NON_BOOL_OPERAND, 51, 5), + error(CompileTimeErrorCode.NON_BOOL_OPERAND, 51, 5), ]); } } @@ -68,7 +68,7 @@ m() { if(x && true) {} } ''', [ - error(StaticTypeWarningCode.NON_BOOL_OPERAND, 21, 1), + error(CompileTimeErrorCode.NON_BOOL_OPERAND, 21, 1), ]); } @@ -79,7 +79,7 @@ m() { if(x || false) {} } ''', [ - error(StaticTypeWarningCode.NON_BOOL_OPERAND, 21, 1), + error(CompileTimeErrorCode.NON_BOOL_OPERAND, 21, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_native_function_type_argument_to_pointer_test.dart b/pkg/analyzer/test/src/diagnostics/non_native_function_type_argument_to_pointer_test.dart index 576cbdbdccf..0ec59d12210 100644 --- a/pkg/analyzer/test/src/diagnostics/non_native_function_type_argument_to_pointer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_native_function_type_argument_to_pointer_test.dart @@ -28,7 +28,7 @@ class C { ''', [ // This changed from a method to a extension method, uses Dart semantics // instead of manual check now. - error(StaticTypeWarningCode.UNDEFINED_METHOD, 98, 10), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 98, 10), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/non_type_as_type_argument_test.dart b/pkg/analyzer/test/src/diagnostics/non_type_as_type_argument_test.dart index 82e57ab474a..cd93d589075 100644 --- a/pkg/analyzer/test/src/diagnostics/non_type_as_type_argument_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_type_as_type_argument_test.dart @@ -21,7 +21,7 @@ int A; class B {} f(B b) {} ''', [ - error(StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT, 25, 1), + error(CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, 25, 1), ]); } @@ -30,7 +30,7 @@ f(B b) {} class B {} f(B b) {} ''', [ - error(StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT, 18, 1), + error(CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, 18, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart b/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart index 67439cb09de..5e10b8c59a6 100644 --- a/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart +++ b/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart @@ -191,7 +191,7 @@ void main(Never? x) { } ''', [ error(CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE, 24, 1), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 25, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 25, 3), ]); assertIndexExpression( @@ -209,8 +209,8 @@ void main(Never? x) { } ''', [ error(CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE, 24, 1), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 25, 3), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 25, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 25, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 25, 3), ]); assertIndexExpression( @@ -230,7 +230,7 @@ void main(Never? x) { } ''', [ error(CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE, 24, 1), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 25, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 25, 3), ]); assertIndexExpression( @@ -536,7 +536,7 @@ void main() { (throw '') + (1 + 2); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 27, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 27, 1), ]); assertBinaryExpression( diff --git a/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart b/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart index 74f3305a6e7..cc197347f7b 100644 --- a/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart @@ -24,7 +24,7 @@ Td f() { return () => "hello"; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 53, 7), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 53, 7), ]); } @@ -35,7 +35,7 @@ class C { } ''', [ error( - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, 33, 1), + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, 33, 1), ]); } @@ -46,7 +46,7 @@ class C { } ''', [ error( - StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, 27, 1), + CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, 27, 1), ]); } @@ -68,7 +68,7 @@ Future f(Future> a) async { return a; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 54, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 54, 1), ]); } @@ -85,7 +85,7 @@ int f() async { return 5; } ''', [ - error(StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE, 0, 3), + error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 0, 3), ]); } @@ -111,7 +111,7 @@ Future f() async { return 5; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 36, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 36, 1), ]); } @@ -121,7 +121,7 @@ void f() async { return 5; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 26, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 26, 1), ]); } @@ -139,7 +139,7 @@ Future f(void a) async { return a; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 39, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 39, 1), ]); } @@ -189,13 +189,13 @@ void f() { return 42; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 20, 2), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 20, 2), ]); } test_function_sync_block_num__to_int() async { var expectedErrors = expectedErrorsByNullability(nullable: [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 24, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 24, 1), ], legacy: []); await assertErrorsInCode(r''' int f(num a) { @@ -210,7 +210,7 @@ int f() { return '0'; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 19, 3), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 19, 3), ]); } @@ -246,13 +246,13 @@ int f(void a) { return a; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 25, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 25, 1), ]); } test_function_sync_block_void__to_Null() async { var expectedErrors = expectedErrorsByNullability(nullable: [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 26, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 26, 1), ], legacy: []); await assertErrorsInCode(''' Null f(void a) { @@ -279,7 +279,7 @@ void f() => 42; await assertErrorsInCode(''' int f() => '0'; ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 11, 3), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 11, 3), ]); } @@ -289,7 +289,7 @@ int get g { return '0'; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 21, 3), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 21, 3), ]); } @@ -297,7 +297,7 @@ int get g { await assertErrorsInCode(''' int get g => '0'; ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 13, 3), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 13, 3), ]); } @@ -310,7 +310,7 @@ void f() { g(); } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 34, 3), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 34, 3), ]); } @@ -323,7 +323,7 @@ class A { } } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 38, 3), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 38, 3), ]); } @@ -354,7 +354,7 @@ class A { } } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 33, 3), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 33, 3), ]); } @@ -376,7 +376,7 @@ class A { int f() => '0'; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 23, 3), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 23, 3), ]); } } @@ -390,7 +390,7 @@ Future f() async { return 0; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 34, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 34, 1), ]); } @@ -400,7 +400,7 @@ Future f(void a) async { return a; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 40, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 40, 1), ]); } @@ -412,7 +412,7 @@ FutureOr f(void a) async { return a; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 67, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 67, 1), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/sdk_version_gt_gt_gt_operator_test.dart b/pkg/analyzer/test/src/diagnostics/sdk_version_gt_gt_gt_operator_test.dart index 4c2223d836d..f535a329637 100644 --- a/pkg/analyzer/test/src/diagnostics/sdk_version_gt_gt_gt_operator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/sdk_version_gt_gt_gt_operator_test.dart @@ -30,7 +30,7 @@ class SdkVersionGtGtGtOperatorTest extends SdkConstraintVerifierTest { await verifyVersion('2.5.0', ''' const a = 42 >>> 3; ''', expectedErrors: [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 13, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 13, 3), ]); } @@ -41,7 +41,7 @@ const a = 42 >>> 3; const a = 42 >>> 3; ''', expectedErrors: [ error(HintCode.SDK_VERSION_GT_GT_GT_OPERATOR, 13, 3), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 13, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 13, 3), ]); } @@ -69,7 +69,7 @@ class A { await verifyVersion('2.5.0', ''' var a = 42 >>> 3; ''', expectedErrors: [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 11, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 11, 3), ]); } @@ -80,7 +80,7 @@ var a = 42 >>> 3; var a = 42 >>> 3; ''', expectedErrors: [ error(HintCode.SDK_VERSION_GT_GT_GT_OPERATOR, 11, 3), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 11, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 11, 3), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/type_alias_cannot_reference_itself_test.dart b/pkg/analyzer/test/src/diagnostics/type_alias_cannot_reference_itself_test.dart index a1993f55987..873b884bd8e 100644 --- a/pkg/analyzer/test/src/diagnostics/type_alias_cannot_reference_itself_test.dart +++ b/pkg/analyzer/test/src/diagnostics/type_alias_cannot_reference_itself_test.dart @@ -33,7 +33,7 @@ main() { } ''', [ error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 0, 37), - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 101, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 101, 1), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/type_parameter_supertype_of_its_bound_test.dart b/pkg/analyzer/test/src/diagnostics/type_parameter_supertype_of_its_bound_test.dart index bf4c60ea508..80d33b841dd 100644 --- a/pkg/analyzer/test/src/diagnostics/type_parameter_supertype_of_its_bound_test.dart +++ b/pkg/analyzer/test/src/diagnostics/type_parameter_supertype_of_its_bound_test.dart @@ -22,7 +22,7 @@ class TypeParameterSupertypeOfItsBoundTest extends DriverResolutionTest { class A { } ''', [ - error(StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 11), + error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 11), ]); } @@ -34,7 +34,7 @@ class A { } } ''', [ - error(StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 11), + error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 11), ]); } @@ -43,9 +43,9 @@ class A { class A { } ''', [ - error(StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 13), + error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 13), error( - StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 27, 13), + CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 27, 13), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_enum_constant_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_enum_constant_test.dart index 1d6ca2ba5d6..866d3ceed0f 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_enum_constant_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_enum_constant_test.dart @@ -31,7 +31,7 @@ E e() { return E.TWO; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_ENUM_CONSTANT, 34, 3), + error(CompileTimeErrorCode.UNDEFINED_ENUM_CONSTANT, 34, 3), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart index 61d98961462..4ba550f54a5 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart @@ -25,7 +25,7 @@ f(C c) { c.foo += 1; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 46, 3), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 46, 3), ]); } @@ -39,7 +39,7 @@ f() { C.foo += 1; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 50, 3), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 50, 3), ]); } @@ -57,7 +57,7 @@ extension E on C { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 95, 3), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 95, 3), ]); } @@ -70,7 +70,7 @@ f() { 0.foo; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 58, 3), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 58, 3), ]); } @@ -79,7 +79,7 @@ f() { extension E on int {} var a = 3.v; ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 32, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 32, 1), ]); } @@ -93,7 +93,7 @@ f(C c) { c.a; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 46, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 46, 1), ]); } @@ -111,7 +111,7 @@ f(C c) { c.foo; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 93, 3), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 93, 3), ]); } @@ -132,7 +132,7 @@ f(int x) { return [if (x is String) x.length]; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 40, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 40, 6), ]); } @@ -150,7 +150,7 @@ f(int x) { return {if (x is String) x : x.length}; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 44, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 44, 6), ]); } @@ -168,7 +168,7 @@ f(int x) { return {if (x is String) x.length}; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 40, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 40, 6), ]); } @@ -188,7 +188,7 @@ f(int x) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 38, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 38, 6), ]); } @@ -207,7 +207,7 @@ f(Object x) { class T {} f(T e) { return e.m; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 29, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 29, 1), ]); } @@ -217,7 +217,7 @@ mixin M { f() { return this.m; } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 30, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 30, 1), ]); } @@ -228,7 +228,7 @@ m() { _null.foo; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 28, 3), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 28, 3), ]); } @@ -238,7 +238,7 @@ f(Object o) { return o.call; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 25, 4), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 25, 4), ]); } @@ -250,7 +250,7 @@ void f(Y y) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 66, 6), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 66, 6), ]); } @@ -266,7 +266,7 @@ main() { new PrefixProxy().foo; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 127, 3), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 127, 3), ]); } @@ -290,7 +290,7 @@ class C extends S {} f(var p) { f(C.g); }''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 75, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 75, 1), ]); } @@ -300,7 +300,7 @@ class C {} f(var p) { f(C.m); }''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 28, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 28, 1), ]); } @@ -313,7 +313,7 @@ main() { T..foo; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 54, 3), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 54, 3), ]); } @@ -324,7 +324,7 @@ main() { class A {} f() => A?.hashCode; ''', [ - error(StaticTypeWarningCode.UNDEFINED_GETTER, 21, 8), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 21, 8), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart index e8f620e5c96..26a8915ff81 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart @@ -169,7 +169,7 @@ main(int p) { } ''', [ error(ParserErrorCode.MISSING_IDENTIFIER, 30, 1), - error(StaticTypeWarningCode.UNDEFINED_GETTER, 30, 1), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 30, 1), error(ParserErrorCode.MISSING_IDENTIFIER, 31, 1), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart index 20615c6246d..c99c2515405 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart @@ -39,7 +39,7 @@ f(B b) { b.a(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 33, 1), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 33, 1), ]); } @@ -58,7 +58,7 @@ f(C c) { c.a(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 33, 1), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 33, 1), ]); } @@ -91,7 +91,7 @@ class C { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 85, 1), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 85, 1), ]); } @@ -99,7 +99,7 @@ class C { await assertErrorsInCode(''' f(bool b, int i) => (b ? null : i).foo(); ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 35, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 35, 3), ]); } @@ -111,7 +111,7 @@ class C { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 22, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 22, 3), ]); } @@ -122,7 +122,7 @@ f(C c) { c..abs(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 25, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 25, 3), ]); } @@ -131,7 +131,7 @@ f(C c) { enum E { A } f() => E.abs(); ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 22, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 22, 3), ]); } @@ -142,7 +142,7 @@ f(M m) { m.abs(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 24, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 24, 3), ]); } @@ -153,7 +153,7 @@ f(M m) { m..abs(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 25, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 25, 3), ]); } @@ -164,7 +164,7 @@ main() { f(42).abs(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 40, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 40, 3), ]); } @@ -194,7 +194,7 @@ void main() { B.named(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 96, 5), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 96, 5), ]); } @@ -210,7 +210,7 @@ f(C c) { c.c(); } ''', [ - error(StaticTypeWarningCode.UNDEFINED_METHOD, 61, 1), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 61, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_operator_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_operator_test.dart index 8f1ee9f0369..b52b9ddd711 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_operator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_operator_test.dart @@ -25,7 +25,7 @@ class B { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 58, 2), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 58, 2), ]); } @@ -38,7 +38,7 @@ f(var a) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 44, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 44, 1), ]); } @@ -47,7 +47,7 @@ f(var a) { enum E { A } f(E e) => e + 1; ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 25, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 25, 1), ]); } @@ -63,7 +63,7 @@ f(var a) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 87, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 87, 1), ]); } @@ -72,7 +72,7 @@ f(var a) { mixin M {} f(M m) => m + 1; ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 23, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 1), ]); } @@ -84,8 +84,8 @@ f(A a) { a[0]++; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 24, 3), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 24, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 24, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 24, 3), ]); } @@ -109,7 +109,7 @@ f(E e) { e[0]; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 25, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 25, 3), ]); } @@ -141,7 +141,7 @@ f(A a) { a[0]; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 125, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 125, 3), ]); } @@ -153,7 +153,7 @@ f(A a) { a[0]; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 24, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 24, 3), ]); } @@ -164,7 +164,7 @@ f(M m) { m[0]; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 23, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 3), ]); } @@ -174,7 +174,7 @@ f(Null x) { x[0]; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 15, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 15, 3), ]); } @@ -192,7 +192,7 @@ f(A a) { a[0] = 1; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 125, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 125, 3), ]); } @@ -218,7 +218,7 @@ f(A a) { a[0] = 1; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 24, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 24, 3), ]); } @@ -229,8 +229,8 @@ f(A a) { a[0]++; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 23, 3), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 23, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 3), ]); } @@ -241,7 +241,7 @@ f(A a) { a[0]; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 23, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 3), ]); } @@ -252,7 +252,7 @@ f(A a) { a[0] = 1; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 23, 3), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 3), ]); } @@ -263,7 +263,7 @@ m() { x - 3; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 20, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 20, 1), ]); } @@ -275,7 +275,7 @@ m() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 20, 2), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 20, 2), ]); } @@ -286,7 +286,7 @@ m() { x + 3; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 20, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 20, 1), ]); } @@ -297,7 +297,7 @@ f(A a) { a + 1; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 24, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 24, 1), ]); } @@ -309,7 +309,7 @@ m() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 20, 2), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 20, 2), ]); } @@ -321,7 +321,7 @@ m() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 19, 2), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 19, 2), ]); } @@ -357,7 +357,7 @@ f(M m) { m++; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 23, 2), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 2), ]); } @@ -368,7 +368,7 @@ f(A a) { a++; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 23, 2), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 2), ]); } @@ -380,7 +380,7 @@ m() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 19, 2), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 19, 2), ]); } @@ -392,7 +392,7 @@ m() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 18, 2), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 18, 2), ]); } @@ -428,7 +428,7 @@ f(M m) { -m; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 22, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 22, 1), ]); } @@ -439,7 +439,7 @@ f(A a) { ++a; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 22, 2), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 22, 2), ]); } @@ -451,7 +451,7 @@ m() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 18, 2), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 18, 2), ]); } @@ -470,7 +470,7 @@ m() { } ''', [ error(HintCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 18, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 18, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart index 3485b605f03..0dbe857af3b 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart @@ -21,7 +21,7 @@ class UndefinedPrefixedNameTest extends DriverResolutionTest { import 'lib.dart' as p; f() => p.c; ''', [ - error(StaticTypeWarningCode.UNDEFINED_PREFIXED_NAME, 33, 1), + error(CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, 33, 1), ]); } @@ -33,7 +33,7 @@ f() { p.c = 0; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_PREFIXED_NAME, 34, 1), + error(CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, 34, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart index b845ece48a0..72afe6f8097 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart @@ -32,7 +32,7 @@ main() { class T {} f(T e1) { e1.m = 0; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SETTER, 24, 1), + error(CompileTimeErrorCode.UNDEFINED_SETTER, 24, 1), ]); } @@ -42,7 +42,7 @@ mixin M { f() { this.m = 0; } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SETTER, 23, 1), + error(CompileTimeErrorCode.UNDEFINED_SETTER, 23, 1), ]); } @@ -58,7 +58,7 @@ f(var a) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SETTER, 80, 1), + error(CompileTimeErrorCode.UNDEFINED_SETTER, 80, 1), ]); } @@ -71,7 +71,7 @@ f(var a) { } } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SETTER, 43, 1), + error(CompileTimeErrorCode.UNDEFINED_SETTER, 43, 1), ]); } @@ -95,7 +95,7 @@ class C extends S {} f(var p) { f(C.s = 1); }''', [ - error(StaticTypeWarningCode.UNDEFINED_SETTER, 75, 1), + error(CompileTimeErrorCode.UNDEFINED_SETTER, 75, 1), ]); } @@ -104,7 +104,7 @@ f(var p) { class A {} f() { A.B = 0;} ''', [ - error(StaticTypeWarningCode.UNDEFINED_SETTER, 19, 1), + error(CompileTimeErrorCode.UNDEFINED_SETTER, 19, 1), ]); } @@ -117,7 +117,7 @@ main() { T..foo = 42; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SETTER, 54, 3), + error(CompileTimeErrorCode.UNDEFINED_SETTER, 54, 3), ]); } @@ -131,7 +131,7 @@ f(C c) { c.a = 1; } ''', [ - error(StaticTypeWarningCode.UNDEFINED_SETTER, 46, 1), + error(CompileTimeErrorCode.UNDEFINED_SETTER, 46, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_non_local_static_member_test.dart b/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_non_local_static_member_test.dart index 52ed3addb96..f142a150dad 100644 --- a/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_non_local_static_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_non_local_static_member_test.dart @@ -28,8 +28,7 @@ class B extends A { } ''', [ error( - StaticTypeWarningCode - .UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, + CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, 80, 1), ]); @@ -48,8 +47,7 @@ class B extends A { } ''', [ error( - StaticTypeWarningCode - .UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, + CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, 72, 3), ]); @@ -67,8 +65,7 @@ class B extends A { } ''', [ error( - StaticTypeWarningCode - .UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, + CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, 66, 1), ]); diff --git a/pkg/analyzer/test/src/diagnostics/use_of_nullable_value_test.dart b/pkg/analyzer/test/src/diagnostics/use_of_nullable_value_test.dart index 096a963ea91..13e3cd27dd9 100644 --- a/pkg/analyzer/test/src/diagnostics/use_of_nullable_value_test.dart +++ b/pkg/analyzer/test/src/diagnostics/use_of_nullable_value_test.dart @@ -625,7 +625,7 @@ m(int? x) { } ''', [ error(CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE, 58, 1), - error(StaticTypeWarningCode.UNDEFINED_GETTER, 60, 3), + error(CompileTimeErrorCode.UNDEFINED_GETTER, 60, 3), ]); } @@ -876,7 +876,7 @@ m(int? x) { } ''', [ error(CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE, 54, 1), - error(StaticTypeWarningCode.UNDEFINED_METHOD, 56, 3), + error(CompileTimeErrorCode.UNDEFINED_METHOD, 56, 3), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart b/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart index e2fbe450f0a..f5b79b4cf42 100644 --- a/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart +++ b/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart @@ -232,7 +232,7 @@ void main() { ''', [ // TODO(mfairhurst) suppress UNDEFINED_OPERATOR error(HintCode.UNUSED_LOCAL_VARIABLE, 21, 1), - error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 26, 1), + error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 26, 1), error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 27, 1), ]); } @@ -582,7 +582,7 @@ dynamic main() { return x; } ''', [ - error(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 36, 1), + error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 36, 1), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_test.dart index 83954f25c77..3d53d64f640 100644 --- a/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_test.dart @@ -20,7 +20,7 @@ class WrongNumberOfTypeArgumentsTest extends DriverResolutionTest { class A {} A a = null; ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 17, 4), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 17, 4), ]); } @@ -29,7 +29,7 @@ A a = null; class A {} A a = null; ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 14, 7), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 14, 7), ]); } @@ -39,7 +39,7 @@ class A {} class M {} class B = A with M; ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 47, 4), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 47, 4), ]); } @@ -53,7 +53,7 @@ f() { return const C(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 47, 6), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 47, 6), ]); } @@ -67,7 +67,7 @@ f() { return const C(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 53, 6), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 53, 6), ]); } @@ -81,7 +81,7 @@ f() { return const C(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 50, 11), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 50, 11), ]); } @@ -89,7 +89,7 @@ f() { await assertErrorsInCode(r''' dynamic v; ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 0, 12), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 0, 12), ]); } @@ -101,7 +101,7 @@ f() { return new C(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 31, 6), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 31, 6), ]); } @@ -113,7 +113,7 @@ f() { return new C(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 37, 6), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 37, 6), ]); } @@ -125,7 +125,7 @@ f() { return new C(); } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 34, 11), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 34, 11), ]); } @@ -138,7 +138,7 @@ main(A a) { a.element.anyGetterExistsInDynamic; } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 36, 6), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 36, 6), ]); } @@ -151,7 +151,7 @@ main(A a) { a.element.anyGetterExistsInDynamic; } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 33, 10), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 33, 10), ]); } @@ -161,7 +161,7 @@ class C { T f; } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 15, 6), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 15, 6), ]); } @@ -173,7 +173,7 @@ f(p) { return p is C; } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 49, 4), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 49, 4), ]); } @@ -185,7 +185,7 @@ f(p) { return p is C; } ''', [ - error(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 46, 7), + error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 46, 7), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/yield_of_invalid_type_test.dart b/pkg/analyzer/test/src/diagnostics/yield_of_invalid_type_test.dart index ba8cc067f5d..53b3bfe08a3 100644 --- a/pkg/analyzer/test/src/diagnostics/yield_of_invalid_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/yield_of_invalid_type_test.dart @@ -28,7 +28,7 @@ Stream f() async* { } ''', expectedErrorsByNullability(nullable: [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 72, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 72, 1), ], legacy: [])); } @@ -39,7 +39,7 @@ int f() async* { } ''', [ error(CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, 0, 3), - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 25, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 25, 1), ]); } @@ -58,7 +58,7 @@ Iterable f() async* { } ''', [ error(CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, 0, 13), - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 35, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 35, 1), ]); } @@ -90,7 +90,7 @@ Stream f() async* { yield 0; } ''', [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 58, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 58, 1), ]); } @@ -111,7 +111,7 @@ Iterable f() sync* { } ''', expectedErrorsByNullability(nullable: [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 51, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 51, 1), ], legacy: [])); } @@ -122,7 +122,7 @@ int f() sync* { } ''', [ error(CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, 0, 3), - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 24, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 24, 1), ]); } @@ -156,7 +156,7 @@ Iterable f() sync* { yield 0; } ''', [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 37, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 37, 1), ]); } @@ -169,7 +169,7 @@ Stream f() sync* { } ''', [ error(CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, 22, 11), - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 54, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 54, 1), ]); } @@ -221,7 +221,7 @@ f() async* { yield* 0; } ''', [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 22, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 22, 1), ]); } @@ -232,7 +232,7 @@ f() async* { yield* a; } ''', [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 41, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 41, 1), ]); } @@ -245,7 +245,7 @@ Stream f() async* { yield* a; } ''', [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 75, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 75, 1), ]); } @@ -258,7 +258,7 @@ Stream f() async* { yield* a; } ''', [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 78, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 78, 1), ]); } @@ -286,7 +286,7 @@ Stream f() async* { Stream g() => throw 0; ''', expectedErrorsByNullability(nullable: [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 56, 3), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 56, 3), ], legacy: [])); } @@ -324,7 +324,7 @@ Stream f() async* { Stream g() => throw 0; ''', [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 56, 3), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 56, 3), ]); } @@ -364,7 +364,7 @@ f() sync* { yield* 0; } ''', [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 21, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 21, 1), ]); } @@ -377,7 +377,7 @@ main() { f; } ''', [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 41, 1), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 41, 1), ]); } @@ -401,7 +401,7 @@ Iterable f() sync* { Iterable g() => throw 0; ''', expectedErrorsByNullability(nullable: [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 35, 3), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 35, 3), ], legacy: [])); } @@ -433,7 +433,7 @@ Iterable f() sync* { Iterable g() => throw 0; ''', [ - error(StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, 35, 3), + error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 35, 3), ]); } } diff --git a/pkg/analyzer/test/src/task/options_test.dart b/pkg/analyzer/test/src/task/options_test.dart index ff939fce283..9188c8c2841 100644 --- a/pkg/analyzer/test/src/task/options_test.dart +++ b/pkg/analyzer/test/src/task/options_test.dart @@ -80,7 +80,7 @@ analyzer: ['x'] ]); var invalid_assignment = AnalysisError( - TestSource(), 0, 1, StaticTypeWarningCode.INVALID_ASSIGNMENT, [ + TestSource(), 0, 1, CompileTimeErrorCode.INVALID_ASSIGNMENT, [ ['x'], ['y'] ]); diff --git a/pkg/analyzer_cli/test/driver_test.dart b/pkg/analyzer_cli/test/driver_test.dart index fe60337919d..cc8ae522c3b 100644 --- a/pkg/analyzer_cli/test/driver_test.dart +++ b/pkg/analyzer_cli/test/driver_test.dart @@ -1110,7 +1110,7 @@ class OptionsTest extends BaseTest { // missing_return: error var undefined_function = AnalysisError( - TestSource(), 0, 1, StaticTypeWarningCode.UNDEFINED_FUNCTION, [ + TestSource(), 0, 1, CompileTimeErrorCode.UNDEFINED_FUNCTION, [ ['x'] ]); expect(processorFor(undefined_function).severity, ErrorSeverity.WARNING); diff --git a/pkg/dev_compiler/tool/dart2js_nnbd_sdk_error_golden.txt b/pkg/dev_compiler/tool/dart2js_nnbd_sdk_error_golden.txt index e5b469ebe38..1abf5189db0 100644 --- a/pkg/dev_compiler/tool/dart2js_nnbd_sdk_error_golden.txt +++ b/pkg/dev_compiler/tool/dart2js_nnbd_sdk_error_golden.txt @@ -3,8 +3,8 @@ ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/i ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1659|7|5|Superinterfaces don't have a valid override for '>>': JSNumber.>> (num Function(num)), int.>> (int Function(int)). ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1659|7|5|Superinterfaces don't have a valid override for '\|': JSNumber.\| (num Function(num)), int.\| (int Function(int)). ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1659|7|5|Superinterfaces don't have a valid override for '^': JSNumber.^ (num Function(num)), int.^ (int Function(int)). -ERROR|STATIC_TYPE_WARNING|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1676|28|1|The operator '&' isn't defined for the type 'JSInt'. -ERROR|STATIC_TYPE_WARNING|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1678|27|1|The operator '&' isn't defined for the type 'JSInt'. -ERROR|STATIC_TYPE_WARNING|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1681|17|1|The operator '&' isn't defined for the type 'JSInt'. -ERROR|STATIC_TYPE_WARNING|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1686|18|1|The operator '&' isn't defined for the type 'JSInt'. -ERROR|STATIC_TYPE_WARNING|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1686|44|1|The operator '&' isn't defined for the type 'JSInt'. +ERROR|COMPILE_TIME_ERROR|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1676|28|1|The operator '&' isn't defined for the type 'JSInt'. +ERROR|COMPILE_TIME_ERROR|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1678|27|1|The operator '&' isn't defined for the type 'JSInt'. +ERROR|COMPILE_TIME_ERROR|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1681|17|1|The operator '&' isn't defined for the type 'JSInt'. +ERROR|COMPILE_TIME_ERROR|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1686|18|1|The operator '&' isn't defined for the type 'JSInt'. +ERROR|COMPILE_TIME_ERROR|UNDEFINED_OPERATOR|lib/_internal/js_runtime/lib/interceptors.dart|1686|44|1|The operator '&' isn't defined for the type 'JSInt'. diff --git a/tests/corelib/cast_errors_test.dart b/tests/corelib/cast_errors_test.dart index 9e2b8eb2e18..b9aa936af9d 100644 --- a/tests/corelib/cast_errors_test.dart +++ b/tests/corelib/cast_errors_test.dart @@ -31,6 +31,6 @@ void testMapDowncast() { // [cfe] A value of type 'C' can't be assigned to a variable of type 'D?'. dMap[d] = c; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'C' can't be assigned to a variable of type 'D?'. } diff --git a/tests/language/assert/initializer_const_function_test.dart b/tests/language/assert/initializer_const_function_test.dart index 27b99bddd80..b581c1dd3df 100644 --- a/tests/language/assert/initializer_const_function_test.dart +++ b/tests/language/assert/initializer_const_function_test.dart @@ -11,7 +11,7 @@ class C { const C.bc01(this.x, y) : assert(staticTrue) // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_EXPRESSION // [cfe] A value of type 'bool Function()' can't be assigned to a variable of type 'bool'. ; } diff --git a/tests/language/assign/static_type_test.dart b/tests/language/assign/static_type_test.dart index d184bf4c1c0..8fba36d2135 100644 --- a/tests/language/assign/static_type_test.dart +++ b/tests/language/assign/static_type_test.dart @@ -7,7 +7,7 @@ int a = "String"; // ^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. class A { @@ -16,19 +16,19 @@ class A { // [analyzer] CHECKED_MODE_COMPILE_TIME_ERROR.VARIABLE_TYPE_MISMATCH // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT final int d = "String"; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. int e = "String"; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. A() { int f = "String"; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. } method( @@ -36,7 +36,7 @@ class A { int g = "String"]) { // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. return g; } diff --git a/tests/language/async/congruence_local_test.dart b/tests/language/async/congruence_local_test.dart index 6ea20da30a3..15e27a2b4c9 100644 --- a/tests/language/async/congruence_local_test.dart +++ b/tests/language/async/congruence_local_test.dart @@ -100,7 +100,7 @@ main() { Future v1 = f_inferred_futureObject(); Future v2 = f_inferred_futureObject(); // ^^^^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Future' can't be assigned to a variable of type 'Future'. @@ -110,7 +110,7 @@ main() { Future v3 = f_inferred_A(); Future v4 = f_inferred_A(); // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Future' can't be assigned to a variable of type 'Future'. } diff --git a/tests/language/async/congruence_method_test.dart b/tests/language/async/congruence_method_test.dart index 57320138b89..663fdf45fbb 100644 --- a/tests/language/async/congruence_method_test.dart +++ b/tests/language/async/congruence_method_test.dart @@ -78,7 +78,7 @@ void checkStaticTypes(C c) { Future v1 = c.f_inferred_A(); Future v2 = c.f_inferred_A(); // ^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Future' can't be assigned to a variable of type 'Future'. } diff --git a/tests/language/async/congruence_unnamed_test.dart b/tests/language/async/congruence_unnamed_test.dart index 274588bf256..0aef8ad0858 100644 --- a/tests/language/async/congruence_unnamed_test.dart +++ b/tests/language/async/congruence_unnamed_test.dart @@ -120,7 +120,7 @@ main() { Future v1 = f_inferred_futureObject(); Future v2 = f_inferred_futureObject(); // ^^^^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Future' can't be assigned to a variable of type 'Future'. @@ -130,7 +130,7 @@ main() { Future v3 = f_inferred_A(); Future v4 = f_inferred_A(); // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Future' can't be assigned to a variable of type 'Future'. } diff --git a/tests/language/async/or_generator_return_type_stacktrace_test.dart b/tests/language/async/or_generator_return_type_stacktrace_test.dart index 1e331db80bd..317b5371513 100644 --- a/tests/language/async/or_generator_return_type_stacktrace_test.dart +++ b/tests/language/async/or_generator_return_type_stacktrace_test.dart @@ -6,7 +6,7 @@ import "package:expect/expect.dart"; int badReturnTypeAsync() async => 0; // [error line 7, column 1, length 3] -// [analyzer] STATIC_TYPE_WARNING.ILLEGAL_ASYNC_RETURN_TYPE +// [analyzer] COMPILE_TIME_ERROR.ILLEGAL_ASYNC_RETURN_TYPE // ^ // [cfe] Functions marked 'async' must have a return type assignable to 'Future'. int badReturnTypeAsyncStar() async* {} diff --git a/tests/language/async/return_types_test.dart b/tests/language/async/return_types_test.dart index 20a3c224a59..f3785496be3 100644 --- a/tests/language/async/return_types_test.dart +++ b/tests/language/async/return_types_test.dart @@ -18,13 +18,13 @@ Future foo3() async { return "String"; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'String' can't be assigned to a variable of type 'FutureOr'. } Future // [error line 25, column 1, length 19] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. foo4() async { return "String"; @@ -32,7 +32,7 @@ foo4() async { int // [error line 33, column 1, length 3] -// [analyzer] STATIC_TYPE_WARNING.ILLEGAL_ASYNC_RETURN_TYPE +// [analyzer] COMPILE_TIME_ERROR.ILLEGAL_ASYNC_RETURN_TYPE foo5() async { // [error line 36, column 1, length 3] // [cfe] Functions marked 'async' must have a return type assignable to 'Future'. diff --git a/tests/language/call/method_implicit_tear_off_assignable_test.dart b/tests/language/call/method_implicit_tear_off_assignable_test.dart index 791b083c3f9..c1e6f25f81d 100644 --- a/tests/language/call/method_implicit_tear_off_assignable_test.dart +++ b/tests/language/call/method_implicit_tear_off_assignable_test.dart @@ -17,6 +17,6 @@ main() { // this is a static error. void Function([int]) f = i; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] unspecified } diff --git a/tests/language/call/non_method_field_test.dart b/tests/language/call/non_method_field_test.dart index 6d30f272afa..bb5b84329ee 100644 --- a/tests/language/call/non_method_field_test.dart +++ b/tests/language/call/non_method_field_test.dart @@ -14,14 +14,14 @@ main() { Fisk x1 = new Fisk(); x1.i(); //^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] 'i' isn't a function or method and can't be invoked. Hest x2 = new Hest(); x2.i(); //^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] 'i' isn't a function or method and can't be invoked. } diff --git a/tests/language/call/object_has_no_call_method_test.dart b/tests/language/call/object_has_no_call_method_test.dart index dcb2a5c1e3d..d02b290cc4a 100644 --- a/tests/language/call/object_has_no_call_method_test.dart +++ b/tests/language/call/object_has_no_call_method_test.dart @@ -6,20 +6,20 @@ void test(dynamic d, Object o, Function f) { d(); o(); //^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'Object'. f(); d.call; o.call; //^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'call' isn't defined for the class 'Object'. f.call; d.call(); o.call(); //^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'call' isn't defined for the class 'Object'. f.call(); } diff --git a/tests/language/call/through_getter_test.dart b/tests/language/call/through_getter_test.dart index 2169e8c6996..06e5af32b32 100644 --- a/tests/language/call/through_getter_test.dart +++ b/tests/language/call/through_getter_test.dart @@ -31,12 +31,12 @@ class CallThroughGetterTest { TOP_LEVEL_CONST(); // ^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. (TOP_LEVEL_CONST)(); // ^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } diff --git a/tests/language/cascade/cascade_test.dart b/tests/language/cascade/cascade_test.dart index 274b23bf5dd..7e674f50ae7 100644 --- a/tests/language/cascade/cascade_test.dart +++ b/tests/language/cascade/cascade_test.dart @@ -93,11 +93,11 @@ main() { // [analyzer] SYNTACTIC_ERROR.MISSING_IDENTIFIER // [cfe] Expected an identifier, but got '37'. // [error line 91, column 8, length 0] - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER a.."foo"; // ^^^^^ // [analyzer] SYNTACTIC_ERROR.MISSING_IDENTIFIER // [cfe] Expected an identifier, but got '"foo"'. // [error line 97, column 11, length 0] - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER } diff --git a/tests/language/closure/internals_test.dart b/tests/language/closure/internals_test.dart index 78f04ab6a32..9efdda3896a 100644 --- a/tests/language/closure/internals_test.dart +++ b/tests/language/closure/internals_test.dart @@ -12,14 +12,14 @@ main() { var f = new C().foo; var target = f.target; // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'target' isn't defined for the class 'dynamic Function()'. var self = f.self; // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'self' isn't defined for the class 'dynamic Function()'. var receiver = f.receiver; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'receiver' isn't defined for the class 'dynamic Function()'. } diff --git a/tests/language/compile_time_constant/static2_test.dart b/tests/language/compile_time_constant/static2_test.dart index 5de087a0336..e38358af28c 100644 --- a/tests/language/compile_time_constant/static2_test.dart +++ b/tests/language/compile_time_constant/static2_test.dart @@ -13,7 +13,7 @@ class A { const A.a2(this.x); const A.a3([this.x = 'foo']); // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. const A.a4(String this.x); // ^^^^^^^^^^^^^ diff --git a/tests/language/compile_time_constant/static3_test.dart b/tests/language/compile_time_constant/static3_test.dart index d6c508bf2a0..612aeb7e799 100644 --- a/tests/language/compile_time_constant/static3_test.dart +++ b/tests/language/compile_time_constant/static3_test.dart @@ -13,7 +13,7 @@ class A { const A.a2(this.x); const A.a3([this.x = 'foo']); // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. const A.a4(String this.x); // ^^^^^^^^^^^^^ diff --git a/tests/language/compile_time_constant/static_test.dart b/tests/language/compile_time_constant/static_test.dart index 288ffef3d2e..a7fb0a8a36f 100644 --- a/tests/language/compile_time_constant/static_test.dart +++ b/tests/language/compile_time_constant/static_test.dart @@ -4,17 +4,17 @@ final int x = 'foo'; // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. const int y = 'foo'; // ^^^^^ // [analyzer] CHECKED_MODE_COMPILE_TIME_ERROR.VARIABLE_TYPE_MISMATCH // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT int z = 'foo'; // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. main() { diff --git a/tests/language/const/conditional_test.dart b/tests/language/const/conditional_test.dart index 33aec86bd93..49437481aad 100644 --- a/tests/language/const/conditional_test.dart +++ b/tests/language/const/conditional_test.dart @@ -73,13 +73,13 @@ const cond4 = zeroConst ? const0 : const1; // [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_TYPE_BOOL // [cfe] A value of type 'int' can't be assigned to a variable of type 'bool'. // ^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION const cond4a = zeroConst ? nonConst : const1; // ^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_TYPE_BOOL // [cfe] A value of type 'int' can't be assigned to a variable of type 'bool'. // ^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // ^ // [cfe] Not a constant expression. const cond4b = zeroConst ? const0 : nonConst; @@ -87,7 +87,7 @@ const cond4b = zeroConst ? const0 : nonConst; // [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_TYPE_BOOL // [cfe] A value of type 'int' can't be assigned to a variable of type 'bool'. // ^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // ^ // [cfe] Not a constant expression. diff --git a/tests/language/const/init2_test.dart b/tests/language/const/init2_test.dart index 7f5e1a32c95..40b7a8bb5ae 100644 --- a/tests/language/const/init2_test.dart +++ b/tests/language/const/init2_test.dart @@ -9,7 +9,7 @@ const double d = intValue; // [analyzer] CHECKED_MODE_COMPILE_TIME_ERROR.VARIABLE_TYPE_MISMATCH // [cfe] A value of type 'int' can't be assigned to a variable of type 'double'. // ^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT main() { print(c); diff --git a/tests/language/constructor/named_constructor_test.dart b/tests/language/constructor/named_constructor_test.dart index d802b9a6cab..3b8af32ad48 100644 --- a/tests/language/constructor/named_constructor_test.dart +++ b/tests/language/constructor/named_constructor_test.dart @@ -24,12 +24,12 @@ void main() { // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // 'Class.named' doesn't fit the grammar syntax T.id: new Class.named().value; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. new prefix.Class().value; @@ -45,7 +45,7 @@ void main() { // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // [cfe] Method not found: 'prefix.Class'. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. new prefix.Class.named().value; @@ -64,7 +64,7 @@ void main() { // 'prefix.Class.named' doesn't fit the grammar syntax T.id: new prefix.Class.named().value; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. // 'prefix.Class' doesn't fit the grammar syntax T.id: @@ -73,7 +73,7 @@ void main() { // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // [cfe] Method not found: 'prefix.Class'. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. @@ -90,7 +90,7 @@ void main() { // 'prefix.Class.named' doesn't fit the grammar syntax T.id: new prefix.Class.named().value; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. // 'prefix.Class.named' doesn't fit the grammar syntax T.id: @@ -99,6 +99,6 @@ void main() { // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // [cfe] Method not found: 'prefix.Class'. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. } diff --git a/tests/language/constructor/reference_test.dart b/tests/language/constructor/reference_test.dart index c1ec04c7681..9246d2b8f11 100644 --- a/tests/language/constructor/reference_test.dart +++ b/tests/language/constructor/reference_test.dart @@ -23,13 +23,13 @@ main() { // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN // [cfe] Expected '(' after this. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'baz' isn't defined for the class 'Foo'. new Foo.bar(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR new Foo.bar.baz(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. @@ -41,7 +41,7 @@ main() { // ^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // ^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^ // [cfe] Method not found: 'Foo.bar.baz'. @@ -60,13 +60,13 @@ main() { // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN // [cfe] Expected '(' after this. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'baz' isn't defined for the class 'Foo'. const Foo.bar(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR const Foo.bar.baz(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. @@ -78,7 +78,7 @@ main() { // ^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // ^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^ // [cfe] Method not found: 'Foo.bar.baz'. @@ -87,7 +87,7 @@ main() { Foo.bar(); Foo.bar.baz(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Getter not found: 'bar'. Foo(); Foo.bar(); @@ -96,13 +96,13 @@ main() { // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN // [cfe] Expected '(' after this. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'baz' isn't defined for the class 'Foo'. Foo.bar(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR Foo.bar.baz(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. @@ -112,6 +112,6 @@ main() { // [cfe] Method not found: 'Foo.bar.baz'. Foo.bar.baz(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Getter not found: 'bar'. } diff --git a/tests/language/control_flow_collections/await_for_downcast_test.dart b/tests/language/control_flow_collections/await_for_downcast_test.dart index 613ebf4de2c..5c6d3ff32a1 100644 --- a/tests/language/control_flow_collections/await_for_downcast_test.dart +++ b/tests/language/control_flow_collections/await_for_downcast_test.dart @@ -17,7 +17,7 @@ Future testList() async { Object obj = stream([1, 2, 3, 4]); var a = [await for (var n in obj) n]; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE // [cfe] The type 'Object' used in the 'for' loop must implement 'Stream'. // Downcast variable. @@ -26,7 +26,7 @@ Future testList() async { // ^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'int'. // ^^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_ELEMENT_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_ELEMENT_TYPE ]; // Downcast element. @@ -43,7 +43,7 @@ Future testMap() async { Object obj = stream([1, 2, 3, 4]); var a = {await for (var n in obj) n: n}; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE // [cfe] The type 'Object' used in the 'for' loop must implement 'Stream'. // Downcast variable. @@ -52,7 +52,7 @@ Future testMap() async { // ^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'int'. // ^^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_ELEMENT_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_ELEMENT_TYPE }; // Downcast element. @@ -72,7 +72,7 @@ Future testSet() async { Object obj = stream([1, 2, 3, 4]); var a = {await for (var n in obj) n}; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE // [cfe] The type 'Object' used in the 'for' loop must implement 'Stream'. // Downcast variable. @@ -81,7 +81,7 @@ Future testSet() async { // ^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'int'. // ^^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_ELEMENT_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_ELEMENT_TYPE }; // Downcast element. diff --git a/tests/language/control_flow_collections/for_downcast_test.dart b/tests/language/control_flow_collections/for_downcast_test.dart index d88e3f6e939..a9eda1d9d64 100644 --- a/tests/language/control_flow_collections/for_downcast_test.dart +++ b/tests/language/control_flow_collections/for_downcast_test.dart @@ -15,7 +15,7 @@ void testList() { Object obj = [1, 2, 3, 4]; var a = [for (var n in obj) n]; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE // [cfe] The type 'Object' used in the 'for' loop must implement 'Iterable'. // Downcast variable. @@ -24,7 +24,7 @@ void testList() { // ^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'int'. // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_ELEMENT_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_ELEMENT_TYPE ]; // Downcast element. @@ -38,7 +38,7 @@ void testList() { // Downcast condition. var d = [for (var i = 1; (i < 2) as Object; i++) i]; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // ^ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } @@ -48,7 +48,7 @@ void testMap() { Object obj = [1, 2, 3, 4]; var a = {for (var n in obj) n: n}; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE // [cfe] The type 'Object' used in the 'for' loop must implement 'Iterable'. // Downcast variable. @@ -57,7 +57,7 @@ void testMap() { // ^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'int'. // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_ELEMENT_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_ELEMENT_TYPE }; // Downcast element. @@ -74,7 +74,7 @@ void testMap() { // Downcast condition. var d = {for (var i = 1; (i < 2) as Object; i++) i: i}; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // ^ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } @@ -84,7 +84,7 @@ void testSet() { Object obj = [1, 2, 3, 4]; var a = {for (var n in obj) n}; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE // [cfe] The type 'Object' used in the 'for' loop must implement 'Iterable'. // Downcast variable. @@ -93,7 +93,7 @@ void testSet() { // ^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'int'. // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_ELEMENT_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_ELEMENT_TYPE }; // Downcast element. @@ -107,7 +107,7 @@ void testSet() { // Downcast condition. var d = {for (var i = 1; (i < 2) as Object; i++) i}; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // ^ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } diff --git a/tests/language/control_flow_collections/if_downcast_test.dart b/tests/language/control_flow_collections/if_downcast_test.dart index 41504569a31..0acfbde83c1 100644 --- a/tests/language/control_flow_collections/if_downcast_test.dart +++ b/tests/language/control_flow_collections/if_downcast_test.dart @@ -5,19 +5,19 @@ void main() { var a = [if (true as Object) 1]; // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // ^ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. var b = {if (true as Object) 1: 1}; // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // ^ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. var c = {if (true as Object) 1}; // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // ^ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } diff --git a/tests/language/covariant/return_type_test.dart b/tests/language/covariant/return_type_test.dart index 43c6c9e58e5..ae6ebaed6d8 100644 --- a/tests/language/covariant/return_type_test.dart +++ b/tests/language/covariant/return_type_test.dart @@ -7,7 +7,7 @@ import 'package:expect/expect.dart'; void main() { List l = [1, 2, 3].where((x) => x.isEven).map((x) => x + 1); // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Iterable' can't be assigned to a variable of type 'List'. @@ -21,7 +21,7 @@ void main() { C c = C(1); List myList = c.f(); // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Iterable' can't be assigned to a variable of type 'List'. } @@ -30,7 +30,7 @@ void main() { C c = C(1); List myList = c.f(); // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Iterable' can't be assigned to a variable of type 'List'. } @@ -50,7 +50,7 @@ void main() { C> c = D([1]); List)> myList = c.f(); // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Iterable)>' can't be assigned to a variable of type 'List)>'. } diff --git a/tests/language/deferred/super_dependency_test.dart b/tests/language/deferred/super_dependency_test.dart index f49380cea18..5879e5667a0 100644 --- a/tests/language/deferred/super_dependency_test.dart +++ b/tests/language/deferred/super_dependency_test.dart @@ -8,7 +8,7 @@ import "package:expect/expect.dart"; // ^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_SETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_SETTER // [cfe] Superclass has no setter named 'foo'. import "super_dependency_lib.dart" deferred as lib; diff --git a/tests/language/enum/private_test.dart b/tests/language/enum/private_test.dart index bd99d849eed..a24fec36e23 100644 --- a/tests/language/enum/private_test.dart +++ b/tests/language/enum/private_test.dart @@ -20,6 +20,6 @@ main() { Expect.equals('Enum2._A,Enum2._B', Enum2.values.join(',')); Expect.throwsNoSuchMethodError(() => Enum2._A); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_ENUM_CONSTANT + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_ENUM_CONSTANT // [cfe] Getter not found: '_A'. } diff --git a/tests/language/extension_methods/static_extension_bounds_error_test.dart b/tests/language/extension_methods/static_extension_bounds_error_test.dart index 5424a7ed62a..60ae8b72313 100644 --- a/tests/language/extension_methods/static_extension_bounds_error_test.dart +++ b/tests/language/extension_methods/static_extension_bounds_error_test.dart @@ -32,7 +32,7 @@ void main() { // Inferred type of String does not satisfy the bound. s.e1; // ^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'e1' isn't defined for the class 'String'. E1(s).e1; //^^ @@ -55,7 +55,7 @@ void main() { // Inferred type of String does not satisfy the bound. s.e2; // ^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'e2' isn't defined for the class 'String'. E2(s).e2; //^^ @@ -121,7 +121,7 @@ void main() { // Inferred super-bounded type is invalid as type argument superRec.e4; // ^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'e4' isn't defined for the class 'Rec'. E4(superRec).e4; //^^ diff --git a/tests/language/extension_methods/static_extension_deferred_import_resolution_error_test.dart b/tests/language/extension_methods/static_extension_deferred_import_resolution_error_test.dart index 59920e77c20..8dc19f1bcd1 100644 --- a/tests/language/extension_methods/static_extension_deferred_import_resolution_error_test.dart +++ b/tests/language/extension_methods/static_extension_deferred_import_resolution_error_test.dart @@ -10,10 +10,10 @@ void main() { Object o = 1; OnObject(o).onObject; //^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION // [cfe] Method not found: 'OnObject'. o.onObject; //^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'onObject' isn't defined for the class 'Object'. } diff --git a/tests/language/extension_methods/static_extension_getter_setter_conflicts_test.dart b/tests/language/extension_methods/static_extension_getter_setter_conflicts_test.dart index bce34aa104c..42c9c6511f5 100644 --- a/tests/language/extension_methods/static_extension_getter_setter_conflicts_test.dart +++ b/tests/language/extension_methods/static_extension_getter_setter_conflicts_test.dart @@ -44,15 +44,15 @@ void test0() { c0.m2 = 0; c0.m2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm2' isn't defined for the class 'C0'. c0.m2 += 0; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm2' isn't defined for the class 'C0'. c0.m2++; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm2' isn't defined for the class 'C0'. E0(c0).m2; @@ -60,7 +60,7 @@ void test0() { c0[0]; c0[0] = 0; //^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C0'. E0(c0)[0]; // ^^^ @@ -70,11 +70,11 @@ void test0() { c0[0] += 0; //^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C0'. c0[0]++; //^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C0'. E0(c0)[0] += 0; @@ -114,24 +114,24 @@ void test1() { c1a.m2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm2' isn't defined for the class 'C1'. c1a.m2 = 0; c1a[0] = 0; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C1'. c1a[0] += 0; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C1'. c1a[0]++; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C1'. c1a[0]; @@ -200,7 +200,7 @@ void test1() { c1c.m2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm2' isn't defined for the class 'C1'. } @@ -230,23 +230,23 @@ extension E2 on C2 { this.m2 = 0; this.m2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm2' isn't defined for the class 'C2'. this[0] = 0; this[0]; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'C2'. this[0] += 0; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'C2'. this[0]++; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'C2'. // Check that `this.mc` refers to `C2.mc`. diff --git a/tests/language/extension_methods/static_extension_import_hide_error_test.dart b/tests/language/extension_methods/static_extension_import_hide_error_test.dart index 9a93aa00625..25b0461ac7d 100644 --- a/tests/language/extension_methods/static_extension_import_hide_error_test.dart +++ b/tests/language/extension_methods/static_extension_import_hide_error_test.dart @@ -12,7 +12,7 @@ void main() { Object o = i; i.onInt; //^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'onInt' isn't defined for the class 'int'. i.onObject; o.onObject; diff --git a/tests/language/extension_methods/static_extension_import_prefixed_hide_error_test.dart b/tests/language/extension_methods/static_extension_import_prefixed_hide_error_test.dart index 3c485e83465..a146f12d75f 100644 --- a/tests/language/extension_methods/static_extension_import_prefixed_hide_error_test.dart +++ b/tests/language/extension_methods/static_extension_import_prefixed_hide_error_test.dart @@ -12,7 +12,7 @@ void main() { Object o = i; i.onInt; //^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'onInt' isn't defined for the class 'int'. i.onObject; o.onObject; diff --git a/tests/language/extension_methods/static_extension_internal_basename_shadowing_error_test.dart b/tests/language/extension_methods/static_extension_internal_basename_shadowing_error_test.dart index f1a92549f61..86941bece2e 100644 --- a/tests/language/extension_methods/static_extension_internal_basename_shadowing_error_test.dart +++ b/tests/language/extension_methods/static_extension_internal_basename_shadowing_error_test.dart @@ -51,7 +51,7 @@ extension E1 on A1 { // The instance getter shadows the global method topLevelMethod(4); // ^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } @@ -143,7 +143,7 @@ extension E3 on A3 { // The static getter shadows the global method topLevelMethod(4); // ^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } @@ -225,7 +225,7 @@ extension E6 on A6 { // The instance getter shadows the other extensions method extensionMethod(4); // ^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } @@ -256,7 +256,7 @@ class A7 extends A6 { // The instance getter shadows the other extensions method extensionMethod(4); // ^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] 'extensionMethod' isn't a function or method and can't be invoked. } @@ -371,7 +371,7 @@ extension E10 on A10 { // The static getter shadows the other extensions method extensionMethod(4); // ^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } @@ -417,7 +417,7 @@ class A11 extends A10 { // The static getter shadows the other extensions method extensionMethod(4); // ^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } diff --git a/tests/language/extension_methods/static_extension_internal_resolution_6_error_test.dart b/tests/language/extension_methods/static_extension_internal_resolution_6_error_test.dart index 38191b85788..dd18be32e8e 100644 --- a/tests/language/extension_methods/static_extension_internal_resolution_6_error_test.dart +++ b/tests/language/extension_methods/static_extension_internal_resolution_6_error_test.dart @@ -29,7 +29,7 @@ extension GenericExtension on T { void shadowTypeParam(T x) { T y = self; // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type '#T' can't be assigned to a variable of type 'T'. } diff --git a/tests/language/extension_methods/static_extension_resolution_failures_test.dart b/tests/language/extension_methods/static_extension_resolution_failures_test.dart index 2856a18899e..ce822ac58ad 100644 --- a/tests/language/extension_methods/static_extension_resolution_failures_test.dart +++ b/tests/language/extension_methods/static_extension_resolution_failures_test.dart @@ -39,7 +39,7 @@ main() { // No `i_num` extension declared. i_num.i_num; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'i_num' isn't defined for the class 'Iterable'. Expect.equals("Iterable.i_num", ii.i_num); diff --git a/tests/language/factory/factory_test.dart b/tests/language/factory/factory_test.dart index b42c2139855..7b0c2a8e094 100644 --- a/tests/language/factory/factory_test.dart +++ b/tests/language/factory/factory_test.dart @@ -36,7 +36,7 @@ class FactoryTest { abstract class Link { factory Link.create() = LinkFactory.create; // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 0 type arguments. // ^^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.REDIRECT_TO_INVALID_RETURN_TYPE diff --git a/tests/language/factory/return_type_checked_test.dart b/tests/language/factory/return_type_checked_test.dart index 0cff11288f8..0913da51eb5 100644 --- a/tests/language/factory/return_type_checked_test.dart +++ b/tests/language/factory/return_type_checked_test.dart @@ -7,7 +7,7 @@ import "package:expect/expect.dart"; class A { factory A() => 42; // ^^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'int' can't be returned from a function with return type 'A'. } diff --git a/tests/language/field/type_check_test.dart b/tests/language/field/type_check_test.dart index 09b550765ae..34315c1e8d9 100644 --- a/tests/language/field/type_check_test.dart +++ b/tests/language/field/type_check_test.dart @@ -9,6 +9,6 @@ class A { void main() { new A().e = "String"; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. } diff --git a/tests/language/function/malformed_result_type_test.dart b/tests/language/function/malformed_result_type_test.dart index 182258b2a74..9f2223ceaf3 100644 --- a/tests/language/function/malformed_result_type_test.dart +++ b/tests/language/function/malformed_result_type_test.dart @@ -11,6 +11,6 @@ class C {} main() { C f() => throw "uncalled"; //^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. } diff --git a/tests/language/function/type_call_getter2_test.dart b/tests/language/function/type_call_getter2_test.dart index c52cb9ea4d4..789f22eedb6 100644 --- a/tests/language/function/type_call_getter2_test.dart +++ b/tests/language/function/type_call_getter2_test.dart @@ -27,42 +27,42 @@ main() { Function a2 = a; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A' can't be assigned to a variable of type 'Function'. final F a3 = a; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A' can't be assigned to a variable of type 'int Function(String)'. final Function b2 = b; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'B' can't be assigned to a variable of type 'Function'. final F b3 = b; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'B' can't be assigned to a variable of type 'int Function(String)'. final Function c2 = c; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'C' can't be assigned to a variable of type 'Function'. final F c3 = c; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'C' can't be assigned to a variable of type 'int Function(String)'. Expect.throwsTypeError(() { diff --git a/tests/language/generic/field_mixin6_test.dart b/tests/language/generic/field_mixin6_test.dart index 47a367819f1..303df88354b 100644 --- a/tests/language/generic/field_mixin6_test.dart +++ b/tests/language/generic/field_mixin6_test.dart @@ -9,7 +9,7 @@ import 'package:expect/expect.dart'; class M { T field1 = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'int' can't be assigned to a variable of type 'T'. T field2 = 0 as dynamic; } diff --git a/tests/language/generic/function_subtype_parametrized_typedef_test.dart b/tests/language/generic/function_subtype_parametrized_typedef_test.dart index a1dd7910277..10775ef0c15 100644 --- a/tests/language/generic/function_subtype_parametrized_typedef_test.dart +++ b/tests/language/generic/function_subtype_parametrized_typedef_test.dart @@ -17,30 +17,30 @@ void foo(H ha, H hb, H hc) { H haa = ha; H hab = hb; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hac = hc; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hba = ha; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hbb = hb; H hbc = hc; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hca = ha; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hcb = hb; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hcc = hc; } diff --git a/tests/language/generic/function_subtype_test.dart b/tests/language/generic/function_subtype_test.dart index 28cb90ac912..d392f6da96b 100644 --- a/tests/language/generic/function_subtype_test.dart +++ b/tests/language/generic/function_subtype_test.dart @@ -14,12 +14,12 @@ void foo() { F1 f11 = f1; F1 f12 = f2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. F2 f21 = f1; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. F2 f22 = f2; } diff --git a/tests/language/generic/function_typedef2_test.dart b/tests/language/generic/function_typedef2_test.dart index 653298843ec..0ad79c51341 100644 --- a/tests/language/generic/function_typedef2_test.dart +++ b/tests/language/generic/function_typedef2_test.dart @@ -27,7 +27,7 @@ typedef J = List; // [cfe] Can't create typedef from non-function type. typedef K = Function(Function(A)); // ^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Can't use type arguments with type variable 'A'. typedef L = Function({x}); // ^ diff --git a/tests/language/generic/wrong_number_type_arguments_test.dart b/tests/language/generic/wrong_number_type_arguments_test.dart index dcc0d9a8287..160e33169ad 100644 --- a/tests/language/generic/wrong_number_type_arguments_test.dart +++ b/tests/language/generic/wrong_number_type_arguments_test.dart @@ -5,18 +5,18 @@ // Map takes 2 type arguments. Map foo = {}; // [error line 6, column 1, length 11] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. Map baz = {}; // [error line 10, column 1, length 11] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. main() { foo = {}; var bar = new Map(); // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. baz = new Map(); } diff --git a/tests/language/getter/no_setter2_test.dart b/tests/language/getter/no_setter2_test.dart index 83d92c4b583..22ad07ef3c8 100644 --- a/tests/language/getter/no_setter2_test.dart +++ b/tests/language/getter/no_setter2_test.dart @@ -18,7 +18,7 @@ class Example { // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_NO_SETTER // [cfe] The getter 'nextVar' isn't defined for the class 'Example'. // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER + // [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // [cfe] The setter 'nextVar' isn't defined for the class 'Example'. } static test() { @@ -31,7 +31,7 @@ class Example { // [analyzer] COMPILE_TIME_ERROR.INVALID_REFERENCE_TO_THIS // [cfe] Expected identifier, but got 'this'. // ^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER +// [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // ^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_NO_SETTER } diff --git a/tests/language/getter/no_setter_test.dart b/tests/language/getter/no_setter_test.dart index c403d327022..260b5fcfc49 100644 --- a/tests/language/getter/no_setter_test.dart +++ b/tests/language/getter/no_setter_test.dart @@ -15,7 +15,7 @@ class Example { // [cfe] Setter not found: 'nextVar'. this.nextVar = 1; // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER + // [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // [cfe] The setter 'nextVar' isn't defined for the class 'Example'. // ^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_NO_SETTER @@ -30,7 +30,7 @@ class Example { // [analyzer] COMPILE_TIME_ERROR.INVALID_REFERENCE_TO_THIS // [cfe] Expected identifier, but got 'this'. // ^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER +// [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // ^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_NO_SETTER } diff --git a/tests/language/getter/setter2_test.dart b/tests/language/getter/setter2_test.dart index a26bd49639e..0985ebe6b35 100644 --- a/tests/language/getter/setter2_test.dart +++ b/tests/language/getter/setter2_test.dart @@ -57,7 +57,7 @@ class T3 { void set field(A arg) { getterField = arg; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. } } @@ -72,7 +72,7 @@ main() { Expect.throwsTypeError(() => instance1.field = new A() as dynamic); B resultB = instance1.field; // ^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. @@ -83,7 +83,7 @@ main() { // Type 'A' has no method named 'b' instance1.field.b(); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'b' isn't defined for the class 'A'. instance3.field = new B(); diff --git a/tests/language/identifier/known_prefix_error_test.dart b/tests/language/identifier/known_prefix_error_test.dart index fe1ea19f32e..06ec097359f 100644 --- a/tests/language/identifier/known_prefix_error_test.dart +++ b/tests/language/identifier/known_prefix_error_test.dart @@ -72,82 +72,82 @@ yield _yield = new yield.A(); async.B _B_async = new async.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'async' isn't a type. await.B _B_await = new await.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'await' isn't a type. hide.B _B_hide = new hide.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'hide' isn't a type. of.B _B_of = new of.B(); // ^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'of' isn't a type. on.B _B_on = new on.B(); // ^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'on' isn't a type. show.B _B_show = new show.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'show' isn't a type. sync.B _B_sync = new sync.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'sync' isn't a type. yield.B _B_yield = new yield.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'yield' isn't a type. async.B> _B2_async = new async.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'async' isn't a type. // ^ // [cfe] Expected 0 type arguments. await.B> _B2_await = new await.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'await' isn't a type. // ^ // [cfe] Expected 0 type arguments. hide.B> _B2_hide = new hide.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'hide' isn't a type. // ^ // [cfe] Expected 0 type arguments. of.B> _B2_of = new of.B(); // ^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'of' isn't a type. // ^ // [cfe] Expected 0 type arguments. on.B> _B2_on = new on.B(); // ^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'on' isn't a type. // ^ // [cfe] Expected 0 type arguments. show.B> _B2_show = new show.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'show' isn't a type. // ^ // [cfe] Expected 0 type arguments. sync.B> _B2_sync = new sync.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'sync' isn't a type. // ^ // [cfe] Expected 0 type arguments. yield.B> _B2_yield = new yield.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'yield' isn't a type. // ^ // [cfe] Expected 0 type arguments. diff --git a/tests/language/if_null/assignment_behavior_test.dart b/tests/language/if_null/assignment_behavior_test.dart index 12da870ac2a..d83be7154f5 100644 --- a/tests/language/if_null/assignment_behavior_test.dart +++ b/tests/language/if_null/assignment_behavior_test.dart @@ -125,7 +125,7 @@ class C { // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL // [cfe] The setter 'finalOne' isn't defined for the class 'C'. // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION yGetValue = 1; @@ -172,7 +172,7 @@ main() { // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_LOCAL // [cfe] Can't assign to the final variable 'l'. // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION C ??= null; @@ -180,7 +180,7 @@ main() { // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_TYPE // [cfe] Can't assign to a type literal. // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION h ??= null; @@ -228,11 +228,11 @@ main() { check(1, () => C?.x ??= bad(), ['C.x']); h.C.xgetValue = 1; // ^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] Setter not found: 'xgetValue'. check(1, () => h.c?.x ??= bad(), ['h.C.x']); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_PREFIXED_NAME + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_PREFIXED_NAME // [cfe] Getter not found: 'c'. yGetValue = 1; check(1, () => C?.x ??= y, ['C.x', 'y', 'C.x=1']); diff --git a/tests/language/if_null/precedence_test.dart b/tests/language/if_null/precedence_test.dart index 2b11622466c..eeb9570cd0f 100644 --- a/tests/language/if_null/precedence_test.dart +++ b/tests/language/if_null/precedence_test.dart @@ -34,7 +34,7 @@ main() { // "(a ?? b) || c" would allow b to have any type provided that a is bool. falsity ?? 1 || true; // ^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'int' can't be assigned to a variable of type 'bool'. // "a || b ?? c" should parse as "(a || b) ?? c", therefore it is a static @@ -42,7 +42,7 @@ main() { // "a || (b ?? c)" would allow b to have any type provided that c is bool. falsity || 1 ?? true; // ^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'int' can't be assigned to a variable of type 'bool'. // ^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION @@ -51,7 +51,7 @@ main() { // error. Expect.throwsAssertionError(() => false || null ?? true); // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. // ^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION diff --git a/tests/language/implicit_downcast_during/assert_initializer_test.dart b/tests/language/implicit_downcast_during/assert_initializer_test.dart index dd8c97560d6..ca323ad260a 100644 --- a/tests/language/implicit_downcast_during/assert_initializer_test.dart +++ b/tests/language/implicit_downcast_during/assert_initializer_test.dart @@ -5,11 +5,11 @@ class C { C.oneArg(Object x) : assert(x); // ^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_EXPRESSION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. C.twoArgs(Object x, Object y) : assert(x, y); // ^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_EXPRESSION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } diff --git a/tests/language/implicit_downcast_during/assert_statement_test.dart b/tests/language/implicit_downcast_during/assert_statement_test.dart index 9f0aa7521aa..d32382e3264 100644 --- a/tests/language/implicit_downcast_during/assert_statement_test.dart +++ b/tests/language/implicit_downcast_during/assert_statement_test.dart @@ -6,11 +6,11 @@ void main() { Object b = true; assert(b); // ^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_EXPRESSION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. assert(b, 'should not fail'); // ^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_EXPRESSION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. assert(false, b); // OK, the message can have any type. diff --git a/tests/language/implicit_downcast_during/assignment_test.dart b/tests/language/implicit_downcast_during/assignment_test.dart index fe9f1e42bfe..fe35a5c3277 100644 --- a/tests/language/implicit_downcast_during/assignment_test.dart +++ b/tests/language/implicit_downcast_during/assignment_test.dart @@ -11,6 +11,6 @@ void main() { A a = new B(); b = a; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. } diff --git a/tests/language/implicit_downcast_during/compound_assignment_test.dart b/tests/language/implicit_downcast_during/compound_assignment_test.dart index a927b55af32..3d092c42f42 100644 --- a/tests/language/implicit_downcast_during/compound_assignment_test.dart +++ b/tests/language/implicit_downcast_during/compound_assignment_test.dart @@ -15,16 +15,16 @@ void main() { //^ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'B'. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT ++b; //^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Object' can't be assigned to a variable of type 'B'. b++; //^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'B'. } diff --git a/tests/language/implicit_downcast_during/conditional_expression_test.dart b/tests/language/implicit_downcast_during/conditional_expression_test.dart index 565f1247a39..ce234c2d9b8 100644 --- a/tests/language/implicit_downcast_during/conditional_expression_test.dart +++ b/tests/language/implicit_downcast_during/conditional_expression_test.dart @@ -6,6 +6,6 @@ void main() { Object b = true; b ? 1 : 2; //^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } diff --git a/tests/language/implicit_downcast_during/do_test.dart b/tests/language/implicit_downcast_during/do_test.dart index f4bebde3213..24aff949e75 100644 --- a/tests/language/implicit_downcast_during/do_test.dart +++ b/tests/language/implicit_downcast_during/do_test.dart @@ -6,6 +6,6 @@ void main() { Object b = false; do {} while (b); // ^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } diff --git a/tests/language/implicit_downcast_during/field_declaration_test.dart b/tests/language/implicit_downcast_during/field_declaration_test.dart index 4f819a21999..abcac19c699 100644 --- a/tests/language/implicit_downcast_during/field_declaration_test.dart +++ b/tests/language/implicit_downcast_during/field_declaration_test.dart @@ -9,18 +9,18 @@ class B extends A {} A a1 = new B(); B b1 = a1; // ^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. class C { static B b3 = a1; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. B b5 = a1; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. } diff --git a/tests/language/implicit_downcast_during/for_condition_test.dart b/tests/language/implicit_downcast_during/for_condition_test.dart index 645b9436be8..a860b6aed99 100644 --- a/tests/language/implicit_downcast_during/for_condition_test.dart +++ b/tests/language/implicit_downcast_during/for_condition_test.dart @@ -6,6 +6,6 @@ void main() { Object b = false; for (int i = 0; b; i++) {} // ^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } diff --git a/tests/language/implicit_downcast_during/for_in_element_test.dart b/tests/language/implicit_downcast_during/for_in_element_test.dart index 30273bed81b..67be51e27cf 100644 --- a/tests/language/implicit_downcast_during/for_in_element_test.dart +++ b/tests/language/implicit_downcast_during/for_in_element_test.dart @@ -11,21 +11,21 @@ void main() { Object o = listOfA; for (B x in o) {} // ^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE // [cfe] The type 'Object' used in the 'for' loop must implement 'Iterable'. for (B x in listOfA) {} // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_ELEMENT_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_ELEMENT_TYPE B y; for (y in o) {} // ^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE // [cfe] The type 'Object' used in the 'for' loop must implement 'Iterable'. for (y in listOfA) {} // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_ELEMENT_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_ELEMENT_TYPE } diff --git a/tests/language/implicit_downcast_during/for_in_iterable_test.dart b/tests/language/implicit_downcast_during/for_in_iterable_test.dart index 09fd2cf9de4..91ca2cac417 100644 --- a/tests/language/implicit_downcast_during/for_in_iterable_test.dart +++ b/tests/language/implicit_downcast_during/for_in_iterable_test.dart @@ -10,15 +10,15 @@ void main() { Object o = []; for (var x in o) {} // ^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE // [cfe] The type 'Object' used in the 'for' loop must implement 'Iterable'. for (B x in o) {} // ^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE // [cfe] The type 'Object' used in the 'for' loop must implement 'Iterable'. B y; for (y in o) {} // ^ - // [analyzer] STATIC_TYPE_WARNING.FOR_IN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.FOR_IN_OF_INVALID_TYPE // [cfe] The type 'Object' used in the 'for' loop must implement 'Iterable'. } diff --git a/tests/language/implicit_downcast_during/for_initializer_expression_test.dart b/tests/language/implicit_downcast_during/for_initializer_expression_test.dart index 8c14537a2e5..98d8dafe037 100644 --- a/tests/language/implicit_downcast_during/for_initializer_expression_test.dart +++ b/tests/language/implicit_downcast_during/for_initializer_expression_test.dart @@ -7,6 +7,6 @@ void main() { int i; for (i = b; i < 1; i++) {} // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Object' can't be assigned to a variable of type 'int'. } diff --git a/tests/language/implicit_downcast_during/for_initializer_var_test.dart b/tests/language/implicit_downcast_during/for_initializer_var_test.dart index 958c1116fae..4b79c20292a 100644 --- a/tests/language/implicit_downcast_during/for_initializer_var_test.dart +++ b/tests/language/implicit_downcast_during/for_initializer_var_test.dart @@ -6,6 +6,6 @@ void main() { Object b = 0; for (int i = b; i < 1; i++) {} // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Object' can't be assigned to a variable of type 'int'. } diff --git a/tests/language/implicit_downcast_during/function_literal_arrow_test.dart b/tests/language/implicit_downcast_during/function_literal_arrow_test.dart index 409ae5b7128..26f0836b713 100644 --- a/tests/language/implicit_downcast_during/function_literal_arrow_test.dart +++ b/tests/language/implicit_downcast_during/function_literal_arrow_test.dart @@ -10,6 +10,6 @@ void main() { A a = new B(); B Function(A) f = (A a) => a; // ^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE_FROM_CLOSURE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE_FROM_CLOSURE // [cfe] A value of type 'A' can't be returned from a function with return type 'B'. } diff --git a/tests/language/implicit_downcast_during/function_literal_return_test.dart b/tests/language/implicit_downcast_during/function_literal_return_test.dart index 1c7a056c11a..7c9acba2db4 100644 --- a/tests/language/implicit_downcast_during/function_literal_return_test.dart +++ b/tests/language/implicit_downcast_during/function_literal_return_test.dart @@ -11,7 +11,7 @@ void main() { B Function(A) f = (A a) { return a; // ^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE_FROM_CLOSURE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE_FROM_CLOSURE // [cfe] A value of type 'A' can't be returned from a function with return type 'B'. }; } diff --git a/tests/language/implicit_downcast_during/if_null_assignment_test.dart b/tests/language/implicit_downcast_during/if_null_assignment_test.dart index 09f1e97890f..7c91b326ac1 100644 --- a/tests/language/implicit_downcast_during/if_null_assignment_test.dart +++ b/tests/language/implicit_downcast_during/if_null_assignment_test.dart @@ -11,6 +11,6 @@ void main() { A? a = new B(); b ??= a; // ^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A?' can't be assigned to a variable of type 'B?'. } diff --git a/tests/language/implicit_downcast_during/if_statement_test.dart b/tests/language/implicit_downcast_during/if_statement_test.dart index fb46a9b9dd3..43894178b34 100644 --- a/tests/language/implicit_downcast_during/if_statement_test.dart +++ b/tests/language/implicit_downcast_during/if_statement_test.dart @@ -6,6 +6,6 @@ void main() { Object b = true; if (b) {} // ^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } diff --git a/tests/language/implicit_downcast_during/indexed_assignment_test.dart b/tests/language/implicit_downcast_during/indexed_assignment_test.dart index 65ae6a48210..1f6493c119d 100644 --- a/tests/language/implicit_downcast_during/indexed_assignment_test.dart +++ b/tests/language/implicit_downcast_during/indexed_assignment_test.dart @@ -18,6 +18,6 @@ void main() { // [analyzer] COMPILE_TIME_ERROR.ARGUMENT_TYPE_NOT_ASSIGNABLE // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. } diff --git a/tests/language/implicit_downcast_during/logical_expression_test.dart b/tests/language/implicit_downcast_during/logical_expression_test.dart index 8e73fa1cae0..123fe62f5e6 100644 --- a/tests/language/implicit_downcast_during/logical_expression_test.dart +++ b/tests/language/implicit_downcast_during/logical_expression_test.dart @@ -6,17 +6,17 @@ void main() { Object o = new Object(); o || o; //^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. // ^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. o && o; //^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. // ^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } diff --git a/tests/language/implicit_downcast_during/not_test.dart b/tests/language/implicit_downcast_during/not_test.dart index de8a43a0a2b..697e32bcb40 100644 --- a/tests/language/implicit_downcast_during/not_test.dart +++ b/tests/language/implicit_downcast_during/not_test.dart @@ -6,6 +6,6 @@ void main() { Object b = true; !b; // ^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_NEGATION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_NEGATION_EXPRESSION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } diff --git a/tests/language/implicit_downcast_during/return_async_test.dart b/tests/language/implicit_downcast_during/return_async_test.dart index 34d041e5d3a..b056db476e5 100644 --- a/tests/language/implicit_downcast_during/return_async_test.dart +++ b/tests/language/implicit_downcast_during/return_async_test.dart @@ -11,14 +11,14 @@ class B extends A {} Future f1(A a) async { return a as FutureOr; // ^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // ^ // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. } Future f2(A a) async => a as FutureOr; // ^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE +// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // ^ // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. diff --git a/tests/language/implicit_downcast_during/return_test.dart b/tests/language/implicit_downcast_during/return_test.dart index e858dc481c4..4a569219d5c 100644 --- a/tests/language/implicit_downcast_during/return_test.dart +++ b/tests/language/implicit_downcast_during/return_test.dart @@ -9,13 +9,13 @@ class B extends A {} B f1(A a) { return a; // ^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'A' can't be returned from a function with return type 'B'. } B f2(A a) => a; // ^ -// [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE +// [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'A' can't be returned from a function with return type 'B'. void main() { diff --git a/tests/language/implicit_downcast_during/variable_declaration_test.dart b/tests/language/implicit_downcast_during/variable_declaration_test.dart index a44f2395dac..216250ca5c8 100644 --- a/tests/language/implicit_downcast_during/variable_declaration_test.dart +++ b/tests/language/implicit_downcast_during/variable_declaration_test.dart @@ -10,6 +10,6 @@ void main() { A a = new B(); B b = a; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. } diff --git a/tests/language/implicit_downcast_during/while_statement_test.dart b/tests/language/implicit_downcast_during/while_statement_test.dart index 3aa386be1dd..6e4bdc9e3bc 100644 --- a/tests/language/implicit_downcast_during/while_statement_test.dart +++ b/tests/language/implicit_downcast_during/while_statement_test.dart @@ -6,6 +6,6 @@ void main() { Object b = false; while (b) {} // ^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } diff --git a/tests/language/implicit_downcast_during/yield_star_test.dart b/tests/language/implicit_downcast_during/yield_star_test.dart index 990ec665eec..800b1c7bc44 100644 --- a/tests/language/implicit_downcast_during/yield_star_test.dart +++ b/tests/language/implicit_downcast_during/yield_star_test.dart @@ -9,7 +9,7 @@ class B extends A {} Iterable f(Iterable a) sync* { yield* a; // ^ - // [analyzer] STATIC_TYPE_WARNING.YIELD_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.YIELD_OF_INVALID_TYPE // [cfe] A value of type 'Iterable' can't be assigned to a variable of type 'Iterable'. } diff --git a/tests/language/implicit_downcast_during/yield_test.dart b/tests/language/implicit_downcast_during/yield_test.dart index 8f98bd2c12e..874ad7f82ba 100644 --- a/tests/language/implicit_downcast_during/yield_test.dart +++ b/tests/language/implicit_downcast_during/yield_test.dart @@ -9,7 +9,7 @@ class B extends A {} Iterable f(A a) sync* { yield a; // ^ - // [analyzer] STATIC_TYPE_WARNING.YIELD_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.YIELD_OF_INVALID_TYPE // [cfe] A value of type 'A' can't be assigned to a variable of type 'B'. } diff --git a/tests/language/import/self_test.dart b/tests/language/import/self_test.dart index 1feeb8811d4..f724a601d05 100644 --- a/tests/language/import/self_test.dart +++ b/tests/language/import/self_test.dart @@ -18,6 +18,6 @@ var _x = "The quick brown fox jumps over the dazy log"; main() { p._x; //^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_PREFIXED_NAME + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_PREFIXED_NAME // [cfe] Getter not found: '_x'. } diff --git a/tests/language/inference/accessor_ref_test.dart b/tests/language/inference/accessor_ref_test.dart index 9d12c5ca3d7..f4437853203 100644 --- a/tests/language/inference/accessor_ref_test.dart +++ b/tests/language/inference/accessor_ref_test.dart @@ -35,14 +35,14 @@ test() { x = new E(); x = new B(); // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'B' can't be assigned to a variable of type 'C?'. y = new C(); y = new E(); y = new B(); // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'B' can't be assigned to a variable of type 'C'. } diff --git a/tests/language/inference/inconsistent_inheritance_test.dart b/tests/language/inference/inconsistent_inheritance_test.dart index 79ba0fc63df..8ff26eb3c92 100644 --- a/tests/language/inference/inconsistent_inheritance_test.dart +++ b/tests/language/inference/inconsistent_inheritance_test.dart @@ -16,7 +16,7 @@ class C extends A implements B { Object y = x; String z = x; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Object' can't be assigned to a variable of type 'String'. } } diff --git a/tests/language/initializing_formal/type_test.dart b/tests/language/initializing_formal/type_test.dart index 41a9f2ac563..b1f739df1fb 100644 --- a/tests/language/initializing_formal/type_test.dart +++ b/tests/language/initializing_formal/type_test.dart @@ -10,7 +10,7 @@ class A { A(int this.x) : y = x { // OK. int z = x; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'num' can't be assigned to a variable of type 'int'. } } diff --git a/tests/language/invalid_returns/async_invalid_return_26_test.dart b/tests/language/invalid_returns/async_invalid_return_26_test.dart index 729e3dc17fa..1fbc602a143 100644 --- a/tests/language/invalid_returns/async_invalid_return_26_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_26_test.dart @@ -17,7 +17,7 @@ void v = null; Future test() async { return v; // ^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'void' can't be returned from an async function with return type 'Future'. } diff --git a/tests/language/invalid_returns/async_invalid_return_27_test.dart b/tests/language/invalid_returns/async_invalid_return_27_test.dart index 4650891c4e4..f3fb9f05af4 100644 --- a/tests/language/invalid_returns/async_invalid_return_27_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_27_test.dart @@ -16,7 +16,7 @@ Future v = Future.value(null); Future test() async { return v; // ^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'Future' can't be returned from an async function with return type 'Future'. } diff --git a/tests/language/invalid_returns/async_invalid_return_28_test.dart b/tests/language/invalid_returns/async_invalid_return_28_test.dart index dd0219813e9..d6c195d40d2 100644 --- a/tests/language/invalid_returns/async_invalid_return_28_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_28_test.dart @@ -16,7 +16,7 @@ FutureOr v = null; Future test() async { return v; // ^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'Future'. } diff --git a/tests/language/invalid_returns/async_invalid_return_29_test.dart b/tests/language/invalid_returns/async_invalid_return_29_test.dart index b2c96c05345..9c924159e77 100644 --- a/tests/language/invalid_returns/async_invalid_return_29_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_29_test.dart @@ -17,7 +17,7 @@ void v = null; FutureOr test() async { return v; // ^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'void' can't be returned from an async function with return type 'FutureOr'. } diff --git a/tests/language/invalid_returns/async_invalid_return_30_test.dart b/tests/language/invalid_returns/async_invalid_return_30_test.dart index b8e09b5dde1..c97fd4f954e 100644 --- a/tests/language/invalid_returns/async_invalid_return_30_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_30_test.dart @@ -16,7 +16,7 @@ Future v = Future.value(null); FutureOr test() async { return v; // ^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'Future' can't be returned from an async function with return type 'FutureOr'. } diff --git a/tests/language/invalid_returns/async_invalid_return_31_test.dart b/tests/language/invalid_returns/async_invalid_return_31_test.dart index f35985b2208..247092597c0 100644 --- a/tests/language/invalid_returns/async_invalid_return_31_test.dart +++ b/tests/language/invalid_returns/async_invalid_return_31_test.dart @@ -16,7 +16,7 @@ FutureOr v = null; FutureOr test() async { return v; // ^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'FutureOr' can't be returned from an async function with return type 'FutureOr'. } diff --git a/tests/language/least_upper_bound/expansive_test.dart b/tests/language/least_upper_bound/expansive_test.dart index 21663df7dc1..78276e50c62 100644 --- a/tests/language/least_upper_bound/expansive_test.dart +++ b/tests/language/least_upper_bound/expansive_test.dart @@ -42,37 +42,37 @@ void testC1(bool z, C1 a, N> b) { // Is least upper bound dynamic? (z ? a : b).z; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'z' isn't defined for the class 'Object'. // Is least upper bound N<...> ? (z ? a : b).n; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound C1<...> ? (z ? a : b).c1; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c1' isn't defined for the class 'Object'. // Is least upper bound N ? (z ? a : b).n.z; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound N> ? (z ? a : b).n.n; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound N> ? (z ? a : b).n.c1; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. } } @@ -106,37 +106,37 @@ void testC2(bool z, C2 a, N> b) { // Is least upper bound dynamic? (z ? a : b).z; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'z' isn't defined for the class 'Object'. // Is least upper bound N<...> ? (z ? a : b).n; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound C2<...> ? (z ? a : b).c2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c2' isn't defined for the class 'Object'. // Is least upper bound N ? (z ? a : b).n.z; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound N> ? (z ? a : b).n.n; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound N> ? (z ? a : b).n.c2; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. } } diff --git a/tests/language/least_upper_bound/least_upper_bound_test.dart b/tests/language/least_upper_bound/least_upper_bound_test.dart index eaf0697c200..562aca371d6 100644 --- a/tests/language/least_upper_bound/least_upper_bound_test.dart +++ b/tests/language/least_upper_bound/least_upper_bound_test.dart @@ -45,21 +45,21 @@ void main() { void testAB(A a, B b) { A r1 = true ? a : b; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'A'. B r2 = false ? a : b; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Object' can't be assigned to a variable of type 'B'. (true ? a : b).a = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'a' isn't defined for the class 'Object'. (false ? a : b).b = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'b' isn't defined for the class 'Object'. var c = new C(); (true ? a as dynamic : c).a = 0; @@ -70,13 +70,13 @@ void testBC(B b, C c) { B r1 = true ? b : c; C r2 = false ? b : c; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'B' can't be assigned to a variable of type 'C'. (true ? b : c).b = 0; (false ? b : c).c = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'c' isn't defined for the class 'B'. var a = null; (true ? b : a).b = 0; @@ -88,23 +88,23 @@ void testBC(B b, C c) { void testCD(C c, D d) { C r1 = true ? c : d; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'B' can't be assigned to a variable of type 'C'. D r2 = false ? c : d; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'B' can't be assigned to a variable of type 'D'. (true ? c : d).b = 0; (false ? c : d).b = 0; (true ? c : d).c = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'c' isn't defined for the class 'B'. (false ? c : d).d = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'd' isn't defined for the class 'B'. } @@ -113,17 +113,17 @@ void testEE(E e, E f) { E r1 = true ? e : f; F r2 = false ? e : f; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. A r3 = true ? e : f; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'A'. B r4 = false ? e : f; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'B'. (true ? e : f).e = C(); @@ -135,23 +135,23 @@ void testEF(E e, F f) { E r1 = true ? e : f; F r2 = false ? e : f; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. A r3 = true ? e : f; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'A'. B r4 = false ? e : f; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'B'. var r5; r5 = (true ? e : f).e; r5 = (false ? e : f).f; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'f' isn't defined for the class 'E'. } diff --git a/tests/language/malformed/inheritance_test.dart b/tests/language/malformed/inheritance_test.dart index 55154d7b0de..8eed85875db 100644 --- a/tests/language/malformed/inheritance_test.dart +++ b/tests/language/malformed/inheritance_test.dart @@ -18,7 +18,7 @@ class C class C1 extends A // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } @@ -36,7 +36,7 @@ class C2 class C3 extends Object with A // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } @@ -52,7 +52,7 @@ class C4 class C5 implements A // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } @@ -63,7 +63,7 @@ class C6 // [analyzer] COMPILE_TIME_ERROR.EXTENDS_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS { } @@ -73,9 +73,9 @@ class C7 // [analyzer] COMPILE_TIME_ERROR.EXTENDS_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } @@ -88,7 +88,7 @@ class C8 // [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS { } @@ -100,9 +100,9 @@ class C9 // [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } @@ -113,7 +113,7 @@ class C10 // [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS { } @@ -123,9 +123,9 @@ class C11 // [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } diff --git a/tests/language/malformed/malformed_test.dart b/tests/language/malformed/malformed_test.dart index b8345e5aaa1..e4b59a9bc55 100644 --- a/tests/language/malformed/malformed_test.dart +++ b/tests/language/malformed/malformed_test.dart @@ -29,25 +29,25 @@ checkIsUnresolved(var v) { checkIsListUnresolved(var v) { v is List; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'Unresolved' isn't a type. v is List>; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'Unresolved' isn't a type. v is List; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // ^ // [cfe] 'Unresolved' isn't a type. v is List>; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // ^ // [cfe] 'Unresolved' isn't a type. v is List; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. } @@ -75,25 +75,25 @@ checkAsUnresolved(var v) { checkAsListUnresolved(var v) { v as List; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'Unresolved' isn't a type. v as List>; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'Unresolved' isn't a type. v as List; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // ^ // [cfe] 'Unresolved' isn't a type. v as List>; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // ^ // [cfe] 'Unresolved' isn't a type. v as List; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. } diff --git a/tests/language/map/literal13_test.dart b/tests/language/map/literal13_test.dart index ec5e0bef927..08f06e4cacb 100644 --- a/tests/language/map/literal13_test.dart +++ b/tests/language/map/literal13_test.dart @@ -7,7 +7,7 @@ main() { var map = new Map{ "a": 1, "b": 2, "c": 3 }; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. // ^ // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN diff --git a/tests/language/mixin/illegal_static_access_test.dart b/tests/language/mixin/illegal_static_access_test.dart index 21e2348239a..8cd792de5a6 100644 --- a/tests/language/mixin/illegal_static_access_test.dart +++ b/tests/language/mixin/illegal_static_access_test.dart @@ -20,10 +20,10 @@ main() { Expect.throwsNoSuchMethodError(() => C.foo()); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'C.foo'. Expect.throwsNoSuchMethodError(() => C.bar()); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'C.bar'. } diff --git a/tests/language/mixin/illegal_super_use_test.dart b/tests/language/mixin/illegal_super_use_test.dart index 89c3a7648c9..ca4764551c1 100644 --- a/tests/language/mixin/illegal_super_use_test.dart +++ b/tests/language/mixin/illegal_super_use_test.dart @@ -11,22 +11,22 @@ class P0 { super.toString(); super.foo(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_METHOD // [cfe] Superclass has no method named 'foo'. super.bar = 100; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_SETTER // [cfe] Superclass has no setter named 'bar'. void inner() { super.toString(); super.foo(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_METHOD // [cfe] Superclass has no method named 'foo'. super.bar = 100; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_SETTER // [cfe] Superclass has no setter named 'bar'. } inner(); @@ -35,11 +35,11 @@ class P0 { super.toString(); super.foo(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_METHOD // [cfe] Superclass has no method named 'foo'. super.bar = 100; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_SETTER // [cfe] Superclass has no setter named 'bar'. })(); diff --git a/tests/language/mixin/type_parameters_errors_test.dart b/tests/language/mixin/type_parameters_errors_test.dart index 2988b2f8374..25e99b6d77a 100644 --- a/tests/language/mixin/type_parameters_errors_test.dart +++ b/tests/language/mixin/type_parameters_errors_test.dart @@ -11,11 +11,11 @@ class B extends S with M { } // ^ // [cfe] The type 'M' can't be mixed in. // ^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. class C extends S with M { } // ^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. class F = S with M; @@ -23,7 +23,7 @@ class G = S with M; // ^ // [cfe] The type 'M' can't be mixed in. // ^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. main() { @@ -32,11 +32,11 @@ main() { a = new A(); a = new A(); // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. a = new F(); a = new F(); // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. } diff --git a/tests/language/nnbd/boolean_conversion/boolean_conversion_error_test.dart b/tests/language/nnbd/boolean_conversion/boolean_conversion_error_test.dart index 695dfa3d0fe..a0bdcf7e26f 100644 --- a/tests/language/nnbd/boolean_conversion/boolean_conversion_error_test.dart +++ b/tests/language/nnbd/boolean_conversion/boolean_conversion_error_test.dart @@ -56,141 +56,141 @@ void main() { // Check that values of type `Null` are not usable as booleans. if (nil) {} // ^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. [if (nil) 3]; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. nil ? 3 : 4; // ^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. while (nil) {} // ^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. do {} while (nil); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. nil || true; // ^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. nil && true; // ^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. true || nil; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. true && nil; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. for (int i = 0; nil; i++) {} // ^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. [for (int i = 0; nil; i++) 3]; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Null' can't be assigned to a variable of type 'bool'. } { // Check that values of type `Object` are not usable as booleans. if (object) {} // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. [if (object) 3]; // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. object ? 3 : 4; // ^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. while (object) {} // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. do {} while (object); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. object || true; // ^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. object && true; // ^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. true || object; // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. true && object; // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. for (int i = 0; object; i++) {} // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. [for (int i = 0; object; i++) 3]; // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object' can't be assigned to a variable of type 'bool'. } { // Check that values of type `Object?` are not usable as booleans. if (objectOrNull) {} // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'. [if (objectOrNull) 3]; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'. objectOrNull ? 3 : 4; // ^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'. while (objectOrNull) {} // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'. do {} while (objectOrNull); // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'. objectOrNull || true; // ^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'. objectOrNull && true; // ^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'. true || objectOrNull; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'. true && objectOrNull; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'. for (int i = 0; objectOrNull; i++) {} // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'. [for (int i = 0; objectOrNull; i++) 3]; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // [cfe] A value of type 'Object?' can't be assigned to a variable of type 'bool'. } } diff --git a/tests/language/nnbd/flow_analysis/unreachable_via_getter_get_error_test.dart b/tests/language/nnbd/flow_analysis/unreachable_via_getter_get_error_test.dart index fe6c7dba559..c7aaf26c826 100644 --- a/tests/language/nnbd/flow_analysis/unreachable_via_getter_get_error_test.dart +++ b/tests/language/nnbd/flow_analysis/unreachable_via_getter_get_error_test.dart @@ -21,7 +21,7 @@ void explicitNeverQuestionType(Object x, bool b) { // to `int`. x.isEven; // ^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] unspecified } diff --git a/tests/language/nnbd/flow_analysis/unreachable_via_invocation_error_test.dart b/tests/language/nnbd/flow_analysis/unreachable_via_invocation_error_test.dart index e5b9c32cba4..8cd5ce72d90 100644 --- a/tests/language/nnbd/flow_analysis/unreachable_via_invocation_error_test.dart +++ b/tests/language/nnbd/flow_analysis/unreachable_via_invocation_error_test.dart @@ -21,7 +21,7 @@ void explicitNeverQuestionType(Object x, bool b) { // promoted to `int`. x.isEven; // ^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] unspecified } diff --git a/tests/language/nnbd/flow_analysis/unreachable_via_promotion_error_test.dart b/tests/language/nnbd/flow_analysis/unreachable_via_promotion_error_test.dart index b76136cb655..46875979c54 100644 --- a/tests/language/nnbd/flow_analysis/unreachable_via_promotion_error_test.dart +++ b/tests/language/nnbd/flow_analysis/unreachable_via_promotion_error_test.dart @@ -18,7 +18,7 @@ void promoteViaIsCheck(Object x, Object? y) { // Since the `y is Never?` branch was reachable, `x` is not promoted to `int`. x.isEven; // ^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] unspecified } diff --git a/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_error_test.dart b/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_error_test.dart index 2f7e6902117..aa97c73ee33 100644 --- a/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_error_test.dart +++ b/tests/language/nnbd/flow_analysis/unreachable_via_variable_get_error_test.dart @@ -19,7 +19,7 @@ void explicitNeverQuestionType(Object x, bool b) { // Since the read of `y` was reachable, `x` is not promoted to `int`. x.isEven; // ^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] unspecified } diff --git a/tests/language/nnbd/flow_analysis/write_promoted_value_in_closure_error_test.dart b/tests/language/nnbd/flow_analysis/write_promoted_value_in_closure_error_test.dart index bd76d000e36..7fd85a582c8 100644 --- a/tests/language/nnbd/flow_analysis/write_promoted_value_in_closure_error_test.dart +++ b/tests/language/nnbd/flow_analysis/write_promoted_value_in_closure_error_test.dart @@ -15,7 +15,7 @@ void functionExpression(Object x) { // an int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. x = 0; }; @@ -31,7 +31,7 @@ void localFunction(Object x) { // an int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. x = 0; } diff --git a/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_error_test.dart b/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_error_test.dart index 646649d39a4..9df5cad28b2 100644 --- a/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_error_test.dart +++ b/tests/language/nnbd/flow_analysis/write_promoted_value_in_loop_error_test.dart @@ -14,7 +14,7 @@ void forLoopAssignInCondition(Object x) { // int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. } } @@ -29,7 +29,7 @@ void forLoopAssignInUpdater(Object x) { // int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. } } @@ -44,7 +44,7 @@ void forLoopAssignInBody(Object x) { // int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. x = 0; } @@ -60,7 +60,7 @@ void forEachAssignInBody(Object x) { // int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. x = 0; } @@ -76,7 +76,7 @@ void whileAssignInCondition(Object x) { // int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. } } @@ -91,7 +91,7 @@ void whileAssignInBody(Object x) { // int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. x = 0; } @@ -107,7 +107,7 @@ void doAssignInCondition(Object x) { // int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. } while ((x = 0) == 0); } @@ -122,7 +122,7 @@ void doAssignInBody(Object x) { // int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. x = 0; } while (true); diff --git a/tests/language/nnbd/flow_analysis/write_promoted_value_in_switch_error_test.dart b/tests/language/nnbd/flow_analysis/write_promoted_value_in_switch_error_test.dart index 9d96b15de3f..ee60537f9ba 100644 --- a/tests/language/nnbd/flow_analysis/write_promoted_value_in_switch_error_test.dart +++ b/tests/language/nnbd/flow_analysis/write_promoted_value_in_switch_error_test.dart @@ -19,7 +19,7 @@ void switchWithLabelAssignInCase(Object x) { // int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. x = 0; break; @@ -40,7 +40,7 @@ void switchWithLabelAssignInDefault(Object x) { // int at the time de-promotion occurs. print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. x = 0; break; diff --git a/tests/language/nnbd/flow_analysis/write_promoted_value_in_try_error_test.dart b/tests/language/nnbd/flow_analysis/write_promoted_value_in_try_error_test.dart index 8f89bdf0d21..6368e1d6913 100644 --- a/tests/language/nnbd/flow_analysis/write_promoted_value_in_try_error_test.dart +++ b/tests/language/nnbd/flow_analysis/write_promoted_value_in_try_error_test.dart @@ -18,7 +18,7 @@ void tryCatchAssignInBody(Object x) { // account for RHS types) print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. } } @@ -36,7 +36,7 @@ void tryFinallyAssignInBody(Object x) { // account for RHS types) print(x.isEven); // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'isEven' isn't defined for the class 'Object'. } } diff --git a/tests/language/nnbd/static_errors/local_function_inference.dart b/tests/language/nnbd/static_errors/local_function_inference.dart index 9cb6a37b150..af811454fa0 100644 --- a/tests/language/nnbd/static_errors/local_function_inference.dart +++ b/tests/language/nnbd/static_errors/local_function_inference.dart @@ -12,7 +12,7 @@ void main() { f().arglebargle; // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'arglebargle' isn't defined for the class 'int'. f().isEven; // Inferred type is int diff --git a/tests/language/nnbd/syntax/class_member_declarations_error_test.dart b/tests/language/nnbd/syntax/class_member_declarations_error_test.dart index 22291999a99..d06b1138fa7 100644 --- a/tests/language/nnbd/syntax/class_member_declarations_error_test.dart +++ b/tests/language/nnbd/syntax/class_member_declarations_error_test.dart @@ -31,7 +31,7 @@ class A { // [analyzer] SYNTACTIC_ERROR.MODIFIER_OUT_OF_ORDER // [cfe] The modifier 'late' should be before the modifier 'final'. // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT covariant late x15; // ^^^^ diff --git a/tests/language/nnbd/try_catch/default_catch_type_error_test.dart b/tests/language/nnbd/try_catch/default_catch_type_error_test.dart index 73b3b942c06..03017a6a43b 100644 --- a/tests/language/nnbd/try_catch/default_catch_type_error_test.dart +++ b/tests/language/nnbd/try_catch/default_catch_type_error_test.dart @@ -6,7 +6,7 @@ void main() { try {} catch (error) { error.notAMethodOnObject(); // ^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'notAMethodOnObject' isn't defined for the class 'Object'. _takesObject(error); } diff --git a/tests/language/nnbd/type_promotion/downwards_inference_error_test.dart b/tests/language/nnbd/type_promotion/downwards_inference_error_test.dart index d54b522ccf2..0906219792e 100644 --- a/tests/language/nnbd/type_promotion/downwards_inference_error_test.dart +++ b/tests/language/nnbd/type_promotion/downwards_inference_error_test.dart @@ -40,18 +40,18 @@ void main() { // x still has type C x.dMethod1("hello"); //^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'dMethod1' isn't defined for the class 'C'. x.dMethod2(3); //^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'dMethod2' isn't defined for the class 'C'. var t0 = x.cMethod("hello"); t0.length; t0.arglebargle; // t0 is not dynamic // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'arglebargle' isn't defined for the class 'String'. // y has type D @@ -59,13 +59,13 @@ void main() { t1.length; t1.arglebargle; // t1 is not dynamic // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'arglebargle' isn't defined for the class 'String'. var t2 = y.dMethod2(3); t2.isEven; t2.arglebargle; // t2 is not dynamic // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'arglebargle' isn't defined for the class 'int'. } @@ -83,13 +83,13 @@ void main() { t0.length; t0.arglebargle; // t0 is not dynamic // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'arglebargle' isn't defined for the class 'String'. var t1 = x.dMethod2(3); t1.isEven; t1.arglebargle; // t1 is not dynamic // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'arglebargle' isn't defined for the class 'int'. // y has type D @@ -97,13 +97,13 @@ void main() { t2.length; t2.arglebargle; // t2 is not dynamic // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'arglebargle' isn't defined for the class 'String'. var t3 = y.dMethod2(3); t3.isEven; t3.arglebargle; // t3 is not dynamic // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'arglebargle' isn't defined for the class 'int'. } @@ -118,34 +118,34 @@ void main() { // x has type C, and not D x.dMethod1("hello"); //^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'dMethod1' isn't defined for the class 'C'. x.dMethod2(3); //^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'dMethod2' isn't defined for the class 'C'. var t0 = x.cMethod("hello"); t0.length; t0.arglebargle; // t0 is not dynamic // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'arglebargle' isn't defined for the class 'String'. // C, and not D y.dMethod1("hello"); //^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'dMethod1' isn't defined for the class 'C'. y.dMethod2(3); //^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'dMethod2' isn't defined for the class 'C'. var t1 = y.cMethod("hello"); t1.length; t1.arglebargle; // t0 is not dynamic // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'arglebargle' isn't defined for the class 'String'. } } diff --git a/tests/language/nnbd/typedef/typedef_error_test.dart b/tests/language/nnbd/typedef/typedef_error_test.dart index f1bed377d69..17488a5ff0a 100644 --- a/tests/language/nnbd/typedef/typedef_error_test.dart +++ b/tests/language/nnbd/typedef/typedef_error_test.dart @@ -13,7 +13,7 @@ int? takesNonNullable(int x) {} void main() { F f = null; // typedefs from opted out libraries are treated as non-nullable // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Null' can't be assigned to a variable of type 'int Function(int)'. f = takesNonNullable; // F is int* Function(int*) diff --git a/tests/language/null/checked_null_test.dart b/tests/language/null/checked_null_test.dart index b4fa1f264f7..9d57242d3f0 100644 --- a/tests/language/null/checked_null_test.dart +++ b/tests/language/null/checked_null_test.dart @@ -25,6 +25,6 @@ bar() { // crash. new A().a?.foo(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'foo' isn't defined for the class 'Map'. } diff --git a/tests/language/null_aware/access_test.dart b/tests/language/null_aware/access_test.dart index deaa991f6ac..4ee967e550f 100644 --- a/tests/language/null_aware/access_test.dart +++ b/tests/language/null_aware/access_test.dart @@ -39,7 +39,7 @@ main() { // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR { String? s = new C(null)?.v; Expect.equals(null, s); } // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'. // ^^ @@ -48,12 +48,12 @@ main() { { h.C.staticInt = 1; int? i = h.C?.staticInt; Expect.equals(1, i); } { C.staticInt = null; String? s = C?.staticInt; Expect.equals(null, s); } // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'. { h.C.staticNullable = null; String? s = h.C?.staticNullable; Expect.equals(null, s); } // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'. @@ -62,11 +62,11 @@ main() { // generated in the case of e1?.id. Expect.equals(null, nullC()?.bad); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'bad' isn't defined for the class 'C'. { B? b = new C(1); Expect.equals(1, b?.v); } // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'v' isn't defined for the class 'B'. // '?.' cannot be used to access toplevel properties in libraries imported via @@ -79,10 +79,10 @@ main() { // Nor can it be used to access the hashCode getter on the class Type. Expect.throwsNoSuchMethodError(() => C?.hashCode); // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Getter not found: 'hashCode'. Expect.throwsNoSuchMethodError(() => h.C?.hashCode); // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Getter not found: 'hashCode'. } diff --git a/tests/language/null_aware/assignment_test.dart b/tests/language/null_aware/assignment_test.dart index 362742719a9..8b7bf1e5780 100644 --- a/tests/language/null_aware/assignment_test.dart +++ b/tests/language/null_aware/assignment_test.dart @@ -60,19 +60,19 @@ main() { { D? d = new D(new E()); G g = new G(); F? f = (d?.v = g); Expect.identical(f, g); } { D? d = new D(new E()); E e = new G(); F? f = (d?.v = e); } // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E?' can't be assigned to a variable of type 'F?'. { D.staticE = new E(); G g = new G(); F? f = (D?.staticE = g); Expect.identical(f, g); } { h.D.staticE = new h.E(); h.G g = new h.G(); h.F? f = (h.D?.staticE = g); Expect.identical(f, g); } { D.staticE = new E(); E e = new G(); F? f = (D?.staticE = e); } // ^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F?'. { h.D.staticE = new h.E(); h.E e = new h.G(); h.F f = (h.D?.staticE = e); } // ^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. @@ -80,13 +80,13 @@ main() { // also generated in the case of e1?.v = e2. Expect.equals(null, nullC()?.bad = bad()); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'bad' isn't defined for the class 'C'. { B b = new C(1); Expect.equals(2, b?.v = 2); } // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'v' isn't defined for the class 'B'. // e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1). @@ -110,16 +110,16 @@ main() { // also generated in the case of e1?.v op= e2. nullC()?.bad = bad(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'bad' isn't defined for the class 'C'. { B b = new C(1); b?.v += 2; } // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'v' isn't defined for the class 'B'. // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'v' isn't defined for the class 'B'. { D d = new D(new E()); F? f = (d?.v += nullC()); } // ^^ @@ -129,7 +129,7 @@ main() { // [cfe] A value of type 'C?' can't be assigned to a variable of type 'int'. { D d = new D(new E()); H? h = (d?.v += 1); } // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G?' can't be assigned to a variable of type 'H?'. // ^^ @@ -144,12 +144,12 @@ main() { // [cfe] A value of type 'C?' can't be assigned to a variable of type 'int'. { D.staticE = new E(); H? h = (D?.staticE += 1); } // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H?'. { h.D.staticE = new h.E(); h.H? hh = (h.D?.staticE += 1); } // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H?'. diff --git a/tests/language/null_aware/increment_decrement_test.dart b/tests/language/null_aware/increment_decrement_test.dart index 1a5ea4e4ca3..0b620fcc7d8 100644 --- a/tests/language/null_aware/increment_decrement_test.dart +++ b/tests/language/null_aware/increment_decrement_test.dart @@ -52,18 +52,18 @@ main() { { E e1 = new E(); D? d = new D(e1); E? e2 = d?.v++; Expect.identical(e1, e2); } { G g = new G(); D? d = new D(g); F? f = d?.v++; Expect.identical(f, g); } // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'E?' can't be assigned to a variable of type 'F?'. { E e1 = new E(); D.staticE = e1; E? e2 = D?.staticE++; Expect.identical(e1, e2); } { h.E e1 = new h.E(); h.D.staticE = e1; h.E? e2 = h.D?.staticE++; Expect.identical(e1, e2); } { G g = new G(); D.staticE = g; F? f = D?.staticE++; Expect.identical(f, g); } // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F?'. { h.G g = new h.G(); h.D.staticE = g; h.F? f = h.D?.staticE++; Expect.identical(f, g); } // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F?'. @@ -79,18 +79,18 @@ main() { { E e1 = new E(); D? d = new D(e1); E? e2 = d?.v--; Expect.identical(e1, e2); } { G g = new G(); D? d = new D(g); F? f = d?.v--; Expect.identical(f, g); } // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'E?' can't be assigned to a variable of type 'F?'. { E e1 = new E(); D.staticE = e1; E? e2 = D?.staticE--; Expect.identical(e1, e2); } { h.E e1 = new h.E(); h.D.staticE = e1; h.E? e2 = h.D?.staticE--; Expect.identical(e1, e2); } { G g = new G(); D.staticE = g; F? f = D?.staticE--; Expect.identical(f, g); } // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F?'. { h.G g = new h.G(); h.D.staticE = g; h.F? f = h.D?.staticE--; Expect.identical(f, g); } // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F?'. @@ -106,19 +106,19 @@ main() { { D? d = new D(new E()); F? f = ++d?.v; Expect.identical(d!.v, f); } { D? d = new D(new E()); H? h = ++d?.v; Expect.identical(d!.v, h); } // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G?' can't be assigned to a variable of type 'H?'. { D.staticE = new E(); F? f = ++D?.staticE; Expect.identical(D.staticE, f); } { h.D.staticE = new h.E(); h.F? f = ++h.D?.staticE; Expect.identical(h.D.staticE, f); } { D.staticE = new E(); H? h = ++D?.staticE; Expect.identical(D.staticE, h); } // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H?'. { h.D.staticE = new h.E(); h.H? hh = ++h.D?.staticE; Expect.identical(h.D.staticE, hh); } // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H?'. @@ -134,19 +134,19 @@ main() { { D? d = new D(new E()); F? f = --d?.v; Expect.identical(d!.v, f); } { D? d = new D(new E()); H? h = --d?.v; Expect.identical(d!.v, h); } // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G?' can't be assigned to a variable of type 'H?'. { D.staticE = new E(); F? f = --D?.staticE; Expect.identical(D.staticE, f); } { h.D.staticE = new h.E(); h.F? f = --h.D?.staticE; Expect.identical(h.D.staticE, f); } { D.staticE = new E(); H? h = --D?.staticE; Expect.identical(D.staticE, h); } // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H?'. { h.D.staticE = new h.E(); h.H? hh = --h.D?.staticE; Expect.identical(h.D.staticE, hh); } // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H?'. } diff --git a/tests/language/null_aware/invocation_test.dart b/tests/language/null_aware/invocation_test.dart index 58f788bb4b9..a1515fa12ff 100644 --- a/tests/language/null_aware/invocation_test.dart +++ b/tests/language/null_aware/invocation_test.dart @@ -43,23 +43,23 @@ main() { { int? i = c?.g(() => 1); Expect.equals(1, i); } { String? s = nullC()?.g(bad()); Expect.equals(null, s); } // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'. { String? s = c?.g(() => null); Expect.equals(null, s); } // ^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'. { int? i = C?.staticG(() => 1); Expect.equals(1, i); } { int? i = h.C?.staticG(() => 1); Expect.equals(1, i); } { String? s = C?.staticG(() => null); Expect.equals(null, s); } // ^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'. { String? s = h.C?.staticG(() => null); Expect.equals(null, s); } // ^^^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int?' can't be assigned to a variable of type 'String?'. @@ -68,7 +68,7 @@ main() { // generated in the case of o?.m(...). { B? b = new C(); Expect.equals(1, b?.f(() => 1)); } // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'f' isn't defined for the class 'B'. { int? i = 1; Expect.equals(null, nullC()?.f(i)); } // ^ @@ -85,10 +85,10 @@ main() { // Nor can it be used to access the toString method on the class Type. Expect.throwsNoSuchMethodError(() => C?.toString()); // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'C.toString'. Expect.throwsNoSuchMethodError(() => h.C?.toString()); // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'C.toString'. } diff --git a/tests/language/number/identifier_test.dart b/tests/language/number/identifier_test.dart index 7b575c5c9e0..d66bf6b31a0 100644 --- a/tests/language/number/identifier_test.dart +++ b/tests/language/number/identifier_test.dart @@ -68,7 +68,7 @@ main() { Expect.equals(1e+2, 1e+2 as double); Expect.throwsNoSuchMethodError(() => 1.e+2); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'e' isn't defined for the class 'int'. 1d; //^ @@ -86,11 +86,11 @@ main() { // [cfe] Getter not found: 'D'. Expect.throwsNoSuchMethodError(() => 1.d+2); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'int'. Expect.throwsNoSuchMethodError(() => 1.D+2); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'D' isn't defined for the class 'int'. 1.1d; //^^^ diff --git a/tests/language/operator/number_operator_error_test.dart b/tests/language/operator/number_operator_error_test.dart index fd2ea6efe51..90e4cf08328 100644 --- a/tests/language/operator/number_operator_error_test.dart +++ b/tests/language/operator/number_operator_error_test.dart @@ -35,115 +35,115 @@ void i += d; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT //^^ // [cfe] A value of type 'double' can't be assigned to a variable of type 'int'. i += n; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT //^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'int'. i += never; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT //^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'int'. i += dyn; // type of `i + dyn` is `num`, not assignable to `int`. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT //^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'int'. ti += i; // Type of expression is `int`, not `I`. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'int' can't be assigned to a variable of type 'I'. ti += d; // Type of expression is `num`, not `I`. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'double' can't be assigned to a variable of type 'I'. ti += n; // Type of expression is `num`, not `I`. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'I'. ti += never; // Type of expression is `num`, not `I`. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'I'. ti += dyn; // type of `i + dyn` is `num`, not assignable to `int`. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'I'. td += i; // Type of expression is `double`, not `D`. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'double' can't be assigned to a variable of type 'D'. td += d; // Type of expression is `double`, not `D`. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'double' can't be assigned to a variable of type 'D'. td += n; // Type of expression is `double`, not `D`. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'double' can't be assigned to a variable of type 'D'. td += dyn; // Type of expression is `double`, not `D`. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'double' can't be assigned to a variable of type 'D'. td += never; // Type of expression is `double`, not `D`. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'double' can't be assigned to a variable of type 'D'. tn += i; // Type of expression is `num`, not `N`. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'N'. tn += d; // Type of expression is `num`, not `N`. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'N'. tn += n; // Type of expression is `num`, not `N`. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'N'. tn += dyn; // Type of expression is `num`, not `N`. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'N'. tn += never; // Type of expression is `num`, not `N`. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'N'. @@ -153,7 +153,7 @@ void oi1 + d; // Valid oi1 += d; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'double' can't be assigned to a variable of type 'O'. } @@ -164,7 +164,7 @@ void oi2 + n; // Valid oi2 += n; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'O'. } @@ -175,7 +175,7 @@ void oi3 + dyn; // Valid oi3 += dyn; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'O'. } @@ -186,7 +186,7 @@ void oi4 + never; // Valid. oi4 += never; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'O'. } @@ -211,13 +211,13 @@ void tn += n; // Type of expression is `num`, not `N`. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'N'. tn += dyn; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'N'. @@ -226,7 +226,7 @@ void // Promote on1 to O&num. on1 += n; // Type of expression is `num`, not `N` or `O`. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'O'. } @@ -236,7 +236,7 @@ void // Promote on2 to O&num. on2 += dyn; // Type of expression is `num`, not `N` or `O`. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^ // [cfe] A value of type 'num' can't be assigned to a variable of type 'O'. } diff --git a/tests/language/override/method_with_field_test.dart b/tests/language/override/method_with_field_test.dart index edd17fdfa1a..7d31ba2f4aa 100644 --- a/tests/language/override/method_with_field_test.dart +++ b/tests/language/override/method_with_field_test.dart @@ -31,7 +31,7 @@ main() { Expect.equals(42, s.superInstanceMethod()); Expect.equals(42, sup.superInstanceMethod()); // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'superInstanceMethod' isn't defined for the class 'Super'. Expect.equals(42, sub.superInstanceMethod()); } diff --git a/tests/language/prefix/shadow_test.dart b/tests/language/prefix/shadow_test.dart index 1680b1ec7d6..1af4c58c56b 100644 --- a/tests/language/prefix/shadow_test.dart +++ b/tests/language/prefix/shadow_test.dart @@ -27,7 +27,7 @@ main() { var result = 0; result = lib10.Library10.static_fld; // ^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'Library10' isn't defined for the class 'int'. Expect.equals(4, result); } diff --git a/tests/language/prefix/transitive_import_test.dart b/tests/language/prefix/transitive_import_test.dart index 582b3e23f6b..ef53584d86d 100644 --- a/tests/language/prefix/transitive_import_test.dart +++ b/tests/language/prefix/transitive_import_test.dart @@ -16,6 +16,6 @@ main() { // Variable should not be visible. lib12.top_level11; // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_PREFIXED_NAME + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_PREFIXED_NAME // [cfe] Getter not found: 'top_level11'. } diff --git a/tests/language/private/access_test.dart b/tests/language/private/access_test.dart index cbfef181ab8..6e10558cd3e 100644 --- a/tests/language/private/access_test.dart +++ b/tests/language/private/access_test.dart @@ -10,13 +10,13 @@ import 'access_lib.dart' as private; main() { _function(); //^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION // [cfe] Method not found: '_function'. private._function(); //^ // [cfe] Method not found: '_function'. // ^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION new _Class(); // ^^^^^^ // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE @@ -25,7 +25,7 @@ main() { //^ // [cfe] Method not found: '_Class'. // ^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION new Class._constructor(); // ^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR diff --git a/tests/language/private/member3_test.dart b/tests/language/private/member3_test.dart index eba3211c42e..557a9e6ca2d 100644 --- a/tests/language/private/member3_test.dart +++ b/tests/language/private/member3_test.dart @@ -10,7 +10,7 @@ class Test extends B { test() { _fun(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method '_fun' isn't defined for the class 'Test'. } } diff --git a/tests/language/regress/regress11724_test.dart b/tests/language/regress/regress11724_test.dart index ddf3925df9a..a408da1dfd2 100644 --- a/tests/language/regress/regress11724_test.dart +++ b/tests/language/regress/regress11724_test.dart @@ -7,6 +7,6 @@ import "package:expect/expect.dart"; void main() { method([]); //^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION // [cfe] Method not found: 'method'. } diff --git a/tests/language/regress/regress1363_test.dart b/tests/language/regress/regress1363_test.dart index a6cab7b5199..812e571eb44 100644 --- a/tests/language/regress/regress1363_test.dart +++ b/tests/language/regress/regress1363_test.dart @@ -24,7 +24,7 @@ class C { C contents = myCup.getContents(); // expect no warning or error contents = libCup.getContents(); // ^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'C/*1*/' can't be assigned to a variable of type 'C/*2*/'. } diff --git a/tests/language/regress/regress18628_1_test.dart b/tests/language/regress/regress18628_1_test.dart index 3f2bef343f8..214f9aab6c3 100644 --- a/tests/language/regress/regress18628_1_test.dart +++ b/tests/language/regress/regress18628_1_test.dart @@ -13,7 +13,7 @@ class C { // line just doesn't make sense without this line. T t = int; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Type' can't be assigned to a variable of type 'T'. } diff --git a/tests/language/regress/regress21912_test.dart b/tests/language/regress/regress21912_test.dart index 6ba343ca556..7d261d32d54 100644 --- a/tests/language/regress/regress21912_test.dart +++ b/tests/language/regress/regress21912_test.dart @@ -19,11 +19,11 @@ void main() { Function2, Function2> left) { left = t1; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A Function(B) Function(B Function(A))' can't be assigned to a variable of type 'double Function(int) Function(double Function(int))'. left = t2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A Function(B) Function(B Function(A))' can't be assigned to a variable of type 'double Function(int) Function(double Function(int))'. } } diff --git a/tests/language/regress/regress22976_test.dart b/tests/language/regress/regress22976_test.dart index 63180f8ce21..de83e9b2170 100644 --- a/tests/language/regress/regress22976_test.dart +++ b/tests/language/regress/regress22976_test.dart @@ -20,7 +20,7 @@ main() { A a0 = c1; A a1 = c2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'C' can't be assigned to a variable of type 'A'. } diff --git a/tests/language/regress/regress33479_test.dart b/tests/language/regress/regress33479_test.dart index 0ede9fbbdc1..f1e8336af9a 100644 --- a/tests/language/regress/regress33479_test.dart +++ b/tests/language/regress/regress33479_test.dart @@ -19,7 +19,7 @@ main() { // ^ // [cfe] A generic function type can't be used as a type argument. // ^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^^^^ // [analyzer] COMPILE_TIME_ERROR.COULD_NOT_INFER // [cfe] Generic function type 'void Function()' inferred as a type argument. diff --git a/tests/language/regress/regress34489_test.dart b/tests/language/regress/regress34489_test.dart index a29cab83db7..7fba3cb4aa9 100644 --- a/tests/language/regress/regress34489_test.dart +++ b/tests/language/regress/regress34489_test.dart @@ -9,6 +9,6 @@ class C { main() { new C().field = 'bad'; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'Type'. } diff --git a/tests/language/regress/regress34495_test.dart b/tests/language/regress/regress34495_test.dart index 41e58bf69ff..2e69b38da87 100644 --- a/tests/language/regress/regress34495_test.dart +++ b/tests/language/regress/regress34495_test.dart @@ -7,7 +7,7 @@ final foo = A.foo(); // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // [cfe] Method not found: 'A'. // ^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'B' isn't a type. main() {} diff --git a/tests/language/regress/regress35043_test.dart b/tests/language/regress/regress35043_test.dart index 884f707196b..d8c1b7578d8 100644 --- a/tests/language/regress/regress35043_test.dart +++ b/tests/language/regress/regress35043_test.dart @@ -4,7 +4,7 @@ final foo = Map(); // ^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. main() {} diff --git a/tests/language/rewrite/implicit_this_test.dart b/tests/language/rewrite/implicit_this_test.dart index 078dcd20a7e..28adbcf3843 100644 --- a/tests/language/rewrite/implicit_this_test.dart +++ b/tests/language/rewrite/implicit_this_test.dart @@ -20,7 +20,7 @@ class Foo { shadow_y_parameter(y) { return x + this.y + y; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. } @@ -28,7 +28,7 @@ class Foo { var y = z; return x + this.y + y; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. } @@ -37,7 +37,7 @@ class Foo { foo() { return x + this.y + y; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. } return foo(); @@ -47,7 +47,7 @@ class Foo { foo(y) { return x + this.y + y; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. } return foo(z); @@ -58,7 +58,7 @@ class Foo { var y = z; return x + this.y + y; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. } @@ -117,10 +117,10 @@ class Foo { shadow_x_toplevel() { return x + this.y + toplevel + this.toplevel; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'toplevel' isn't defined for the class 'Foo'. } } diff --git a/tests/language/setter/no_getter_call_test.dart b/tests/language/setter/no_getter_call_test.dart index 77b06dc9520..a49d8e4c5bb 100644 --- a/tests/language/setter/no_getter_call_test.dart +++ b/tests/language/setter/no_getter_call_test.dart @@ -23,7 +23,7 @@ main() { x = topLevel(3); // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION // [cfe] Getter not found: 'topLevel'. Expect.equals(6, x); } diff --git a/tests/language/setter/no_getter_test.dart b/tests/language/setter/no_getter_test.dart index f2ea3e36a03..53c8b58ba73 100644 --- a/tests/language/setter/no_getter_test.dart +++ b/tests/language/setter/no_getter_test.dart @@ -17,6 +17,6 @@ main() { Example ex = new Example(); print(ex.foo++); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'foo' isn't defined for the class 'Example'. } diff --git a/tests/language/static/field1_test.dart b/tests/language/static/field1_test.dart index e4e147270a1..7c3c338b8ca 100644 --- a/tests/language/static/field1_test.dart +++ b/tests/language/static/field1_test.dart @@ -14,7 +14,7 @@ class StaticField1Test { var foo = new Foo(); var x = foo.x; // ^ - // [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER + // [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // [cfe] The getter 'x' isn't defined for the class 'Foo'. } } diff --git a/tests/language/static/field1a_test.dart b/tests/language/static/field1a_test.dart index 9d7f2f258ee..27a336d8181 100644 --- a/tests/language/static/field1a_test.dart +++ b/tests/language/static/field1a_test.dart @@ -14,7 +14,7 @@ class StaticField1aTest { var foo = new Foo(); var m = foo.m; // ^ - // [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER + // [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // [cfe] The getter 'm' isn't defined for the class 'Foo'. } } diff --git a/tests/language/static/field3_test.dart b/tests/language/static/field3_test.dart index 0498f48f008..f794e68c490 100644 --- a/tests/language/static/field3_test.dart +++ b/tests/language/static/field3_test.dart @@ -21,7 +21,7 @@ main() { // [cfe] Getter not found: 'm'. Foo.m = 1; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] Setter not found: 'm'. Foo.x = 1; // ^ diff --git a/tests/language/string/interpolation_test.dart b/tests/language/string/interpolation_test.dart index 50968b09721..2b0f4e568a1 100644 --- a/tests/language/string/interpolation_test.dart +++ b/tests/language/string/interpolation_test.dart @@ -60,7 +60,7 @@ class StringInterpolationTest { if (alwaysFalse) { "${i.toHorse()}"; // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'toHorse' isn't defined for the class 'int'. } diff --git a/tests/language/string/no_operator_test.dart b/tests/language/string/no_operator_test.dart index d5d013c7727..a7eabf71677 100644 --- a/tests/language/string/no_operator_test.dart +++ b/tests/language/string/no_operator_test.dart @@ -9,23 +9,23 @@ main() { var y = "y"; Expect.throws(() => x < y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '<' isn't defined for the class 'String'. Expect.throws(() => x <= y); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '<=' isn't defined for the class 'String'. Expect.throws(() => x > y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '>' isn't defined for the class 'String'. Expect.throws(() => x >= y); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '>=' isn't defined for the class 'String'. Expect.throws(() => x - y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '-' isn't defined for the class 'String'. Expect.throws(() => x * y); // ^ @@ -33,42 +33,42 @@ main() { // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. Expect.throws(() => x / y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '/' isn't defined for the class 'String'. Expect.throws(() => x ~/ y); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '~/' isn't defined for the class 'String'. Expect.throws(() => x % y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '%' isn't defined for the class 'String'. Expect.throws(() => x >> y); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '>>' isn't defined for the class 'String'. Expect.throws(() => x << y); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '<<' isn't defined for the class 'String'. Expect.throws(() => x & y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '&' isn't defined for the class 'String'. Expect.throws(() => x | y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '|' isn't defined for the class 'String'. Expect.throws(() => x ^ y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '^' isn't defined for the class 'String'. Expect.throws(() => -x); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator 'unary-' isn't defined for the class 'String'. Expect.throws(() => ~x); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '~' isn't defined for the class 'String'. } diff --git a/tests/language/string/string_test.dart b/tests/language/string/string_test.dart index 1ab3f926176..dfe4447480d 100644 --- a/tests/language/string/string_test.dart +++ b/tests/language/string/string_test.dart @@ -31,7 +31,7 @@ class StringTest { String a = "Hello"; a[1] = 12; // ^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'String'. } diff --git a/tests/language/super/assign_test.dart b/tests/language/super/assign_test.dart index bfb2c38c043..9c09982b1b0 100644 --- a/tests/language/super/assign_test.dart +++ b/tests/language/super/assign_test.dart @@ -17,6 +17,6 @@ main() { a.x = 37; a.setX(42); //^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'setX' isn't defined for the class 'A'. } diff --git a/tests/language/super/conditional_operator_test.dart b/tests/language/super/conditional_operator_test.dart index c15182d888d..1c473488e87 100644 --- a/tests/language/super/conditional_operator_test.dart +++ b/tests/language/super/conditional_operator_test.dart @@ -70,7 +70,7 @@ class C extends B { // [analyzer] SYNTACTIC_ERROR.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER !super?.field; // ^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_NEGATION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_NEGATION_EXPRESSION // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR // [cfe] The operator '?.' cannot be used with 'super' because 'super' cannot be null. diff --git a/tests/language/symbol/literal_test.dart b/tests/language/symbol/literal_test.dart index 268b610c05f..976158f7221 100644 --- a/tests/language/symbol/literal_test.dart +++ b/tests/language/symbol/literal_test.dart @@ -46,7 +46,7 @@ main() { // Tries to call the symbol literal #a.toString Expect.throwsNoSuchMethodError(() => #a.toString()); // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'Symbol'. } diff --git a/tests/language/sync_star/generator1_test.dart b/tests/language/sync_star/generator1_test.dart index 79b294d4c04..ef6bd9bf098 100644 --- a/tests/language/sync_star/generator1_test.dart +++ b/tests/language/sync_star/generator1_test.dart @@ -48,7 +48,7 @@ dreiVier() sync* { // Throws type error: yielded object is not an iterable. yield* 3; // ^ - // [analyzer] STATIC_TYPE_WARNING.YIELD_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.YIELD_OF_INVALID_TYPE // [cfe] A value of type 'int' can't be assigned to a variable of type 'Iterable'. } diff --git a/tests/language/this/conditional_operator_test.dart b/tests/language/this/conditional_operator_test.dart index 85060a59ee7..5254ea2300b 100644 --- a/tests/language/this/conditional_operator_test.dart +++ b/tests/language/this/conditional_operator_test.dart @@ -21,7 +21,7 @@ class B { //^^^^^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD // [error line 15, column 11, length 0] - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Expected '.' before this. // ^^ // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN diff --git a/tests/language/type_object/first_class_types_literals_test.dart b/tests/language/type_object/first_class_types_literals_test.dart index e8fdca56bc7..663e5162ea3 100644 --- a/tests/language/type_object/first_class_types_literals_test.dart +++ b/tests/language/type_object/first_class_types_literals_test.dart @@ -54,46 +54,46 @@ main() { // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_TYPE // [cfe] Can't assign to a type literal. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT Expect.throwsNoSuchMethodError(() => C++); // ^ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_TYPE // [cfe] Can't assign to a type literal. // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR Expect.throwsNoSuchMethodError(() => C + 1); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '+' isn't defined for the class 'Type'. Expect.throwsNoSuchMethodError(() => C[2]); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'Type'. Expect.throwsNoSuchMethodError(() => C[2] = 'hest'); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'Type'. Expect.throwsNoSuchMethodError(() => dynamic = 1); // ^ // [cfe] Can't assign to a type literal. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT Expect.throwsNoSuchMethodError(() => dynamic++); // ^ // [cfe] Can't assign to a type literal. // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR Expect.throwsNoSuchMethodError(() => dynamic + 1); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '+' isn't defined for the class 'Type'. Expect.throwsNoSuchMethodError(() => dynamic[2]); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'Type'. Expect.throwsNoSuchMethodError(() => dynamic[2] = 'hest'); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'Type'. Expect.equals((dynamic).toString(), 'dynamic'); diff --git a/tests/language/type_promotion/assign_test.dart b/tests/language/type_promotion/assign_test.dart index 737a75063ac..74c1322ba51 100644 --- a/tests/language/type_promotion/assign_test.dart +++ b/tests/language/type_promotion/assign_test.dart @@ -39,7 +39,7 @@ void main() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } if (a is B) { @@ -51,7 +51,7 @@ void main() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } } diff --git a/tests/language/type_promotion/closure_test.dart b/tests/language/type_promotion/closure_test.dart index 17246dc2b87..7606728d726 100644 --- a/tests/language/type_promotion/closure_test.dart +++ b/tests/language/type_promotion/closure_test.dart @@ -70,7 +70,7 @@ void test2() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } } @@ -85,7 +85,7 @@ void test3() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. void foo() { a = new D(); @@ -94,7 +94,7 @@ void test3() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } } @@ -109,7 +109,7 @@ void test3a() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. void foo() { a = new D(); @@ -118,7 +118,7 @@ void test3a() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } } @@ -137,7 +137,7 @@ void test5() { if (a is B) { func(() => a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.a); } @@ -178,7 +178,7 @@ void test8() { if (a is B && func(() => a.b) // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. ) { print(a.a); @@ -190,7 +190,7 @@ void test9() { A a = new E(); var b = a is B ? func(() => a.b) : false; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. a = A(); } @@ -220,7 +220,7 @@ void test12() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } a = A(); diff --git a/tests/language/type_promotion/functions_test.dart b/tests/language/type_promotion/functions_test.dart index 94aee2f2a19..4aecc3bdc05 100644 --- a/tests/language/type_promotion/functions_test.dart +++ b/tests/language/type_promotion/functions_test.dart @@ -87,7 +87,7 @@ testFuncDynToDyn() { b = funcDynToDyn(new B()) as B; c = funcDynToDyn(new C()); // ^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'C'. } @@ -124,7 +124,7 @@ testFuncDynToVoid() { b = funcDynToVoid(new B()) as B; c = funcDynToVoid(new C()); // ^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'C'. } @@ -136,7 +136,7 @@ testFuncDynToA() { b = funcDynToA(new B()) as B; c = funcDynToA(new C()); // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'C'. @@ -146,7 +146,7 @@ testFuncDynToA() { b = funcDynToA(new B()) as B; c = funcDynToA(new C()); // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'C'. } @@ -157,7 +157,7 @@ testFuncDynToA() { b = funcDynToA(new B()) as B; c = funcDynToA(new C()); // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'C'. } diff --git a/tests/language/type_promotion/local_test.dart b/tests/language/type_promotion/local_test.dart index c0fe87d649a..85b0386e604 100644 --- a/tests/language/type_promotion/local_test.dart +++ b/tests/language/type_promotion/local_test.dart @@ -32,15 +32,15 @@ void main() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. if (a is B) { @@ -48,11 +48,11 @@ void main() { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. if (a is C) { @@ -61,7 +61,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } @@ -69,11 +69,11 @@ void main() { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. } if (a is C) { @@ -82,7 +82,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. if (a is B) { @@ -91,7 +91,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is D) { @@ -100,7 +100,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } @@ -109,33 +109,33 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. if (a is D) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. print(a.d); } @@ -143,15 +143,15 @@ void main() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. var o1 = a is B @@ -159,24 +159,24 @@ void main() { '${a.b}' '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -186,20 +186,20 @@ void main() { '${a.c}' '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -207,25 +207,25 @@ void main() { ? '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. '${a.d}' : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -234,11 +234,11 @@ void main() { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. } if (a is B && a is C) { @@ -247,7 +247,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is C && a is B) { @@ -256,7 +256,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is C && a is D) { @@ -265,18 +265,18 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is D && a is C) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. print(a.d); } diff --git a/tests/language/type_promotion/more_specific_test.dart b/tests/language/type_promotion/more_specific_test.dart index 21392a373d2..cf95b4aed21 100644 --- a/tests/language/type_promotion/more_specific_test.dart +++ b/tests/language/type_promotion/more_specific_test.dart @@ -48,7 +48,7 @@ void testInterface() { // No promotion C !<< A. x = a.c; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. } B b = new B(); @@ -60,7 +60,7 @@ void testInterface() { // Promotion A << dynamic. y = x.b; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } } @@ -78,12 +78,12 @@ testGeneric() { // Promotion: E << D. int a = d1.d; // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'int'. String b = d1.d; // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'String'. x = d1.e; @@ -94,7 +94,7 @@ testGeneric() { // No promotion: E !<< D x = d2.e; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'e' isn't defined for the class 'D'. } diff --git a/tests/language/type_promotion/multiple_test.dart b/tests/language/type_promotion/multiple_test.dart index 8410597bab0..21a2f7dc7e5 100644 --- a/tests/language/type_promotion/multiple_test.dart +++ b/tests/language/type_promotion/multiple_test.dart @@ -36,29 +36,29 @@ void test(A a1) { print(a1.a); print(a1.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a1.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a1.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. print(a2.a); print(a2.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a2.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a2.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. if (a1 is B && a2 is C) { @@ -66,11 +66,11 @@ void test(A a1) { print(a1.b); print(a1.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a1.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. print(a2.a); @@ -78,7 +78,7 @@ void test(A a1) { print(a2.c); print(a2.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. if (a1 is C && a2 is D) { @@ -87,7 +87,7 @@ void test(A a1) { print(a1.c); print(a1.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. print(a2.a); @@ -95,7 +95,7 @@ void test(A a1) { print(a2.c); print(a2.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } } @@ -105,44 +105,44 @@ void test(A a1) { '${a1.b}' '${a1.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. '${a1.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. '${a2.a}' '${a2.b}' '${a2.c}' '${a2.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. : '${a1.a}' '${a1.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a1.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a1.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. '${a2.a}' '${a2.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a2.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a2.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -152,7 +152,7 @@ void test(A a1) { print(a1.c); print(a1.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. print(a2.a); @@ -160,7 +160,7 @@ void test(A a1) { print(a2.c); print(a2.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } } diff --git a/tests/language/type_promotion/parameter_test.dart b/tests/language/type_promotion/parameter_test.dart index b93d76417ff..7ce711971e8 100644 --- a/tests/language/type_promotion/parameter_test.dart +++ b/tests/language/type_promotion/parameter_test.dart @@ -35,15 +35,15 @@ void test(A a) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. if (a is B) { @@ -51,11 +51,11 @@ void test(A a) { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. if (a is C) { @@ -64,7 +64,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } @@ -72,11 +72,11 @@ void test(A a) { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. } if (a is C) { @@ -85,7 +85,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. if (a is B) { @@ -94,7 +94,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is D) { @@ -103,7 +103,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } @@ -112,33 +112,33 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. if (a is D) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. print(a.d); } @@ -146,15 +146,15 @@ void test(A a) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. var o1 = a is B @@ -162,24 +162,24 @@ void test(A a) { '${a.b}' '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -189,20 +189,20 @@ void test(A a) { '${a.c}' '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -210,25 +210,25 @@ void test(A a) { ? '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. '${a.d}' : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -237,11 +237,11 @@ void test(A a) { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. } if (a is B && a is C) { @@ -250,7 +250,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is C && a is B) { @@ -259,7 +259,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is C && a is D) { @@ -268,18 +268,18 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is D && a is C) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. print(a.d); } @@ -287,37 +287,37 @@ void test(A a) { a.a == "" && a.b == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. && a.c == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. && a.d == "") { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. print(a.d); } if (a.a == "" && a.b == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. && a.c == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. && a.d == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. && a is B && @@ -325,11 +325,11 @@ void test(A a) { a.b == "" && a.c == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. && a.d == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. && a is C && @@ -338,7 +338,7 @@ void test(A a) { a.c == "" && a.d == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. ) { print(a.a); @@ -346,7 +346,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if ((a is B)) { @@ -354,11 +354,11 @@ void test(A a) { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. } if ((a is B && (a) is C) && a is B) { @@ -367,7 +367,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } } diff --git a/tests/language/type_variable/bound_access_test.dart b/tests/language/type_variable/bound_access_test.dart index 77f85945ed5..39d52ea229e 100644 --- a/tests/language/type_variable/bound_access_test.dart +++ b/tests/language/type_variable/bound_access_test.dart @@ -21,7 +21,7 @@ class NumClass { num method2() => field1 + field2.length; // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'length' isn't defined for the class 'num'. } diff --git a/tests/language/type_variable/conflict2_test.dart b/tests/language/type_variable/conflict2_test.dart index 8b8439d1225..f43e6091186 100644 --- a/tests/language/type_variable/conflict2_test.dart +++ b/tests/language/type_variable/conflict2_test.dart @@ -14,13 +14,13 @@ class C { // This is equivalent to (T).call(). See issue 19725 foo() => T(); // ^ - // [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION + // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION // [cfe] Method not found: 'T'. // T is in scope, even in static context. Compile-time error to call this.T(). static bar() => T(); // ^ - // [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION + // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION // [cfe] Method not found: 'T'. // ^ // [analyzer] COMPILE_TIME_ERROR.TYPE_PARAMETER_REFERENCED_BY_STATIC @@ -28,26 +28,26 @@ class C { // X is not in scope. NoSuchMethodError. static baz() => X(); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'X'. // Class 'C' has no static method 'T': NoSuchMethodError. static qux() => C.T(); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'C.T'. // Class '_Type' has no instance method 'call': NoSuchMethodError. quux() => (T)(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'Type'. // Runtime type T not accessible from static context. Compile-time error. static corge() => (T)(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [analyzer] COMPILE_TIME_ERROR.TYPE_PARAMETER_REFERENCED_BY_STATIC // [cfe] Type variables can't be used in static members. @@ -57,7 +57,7 @@ class C { // Class '_Type' has no [] operator: NoSuchMethodError. grault() => T[0]; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'Type'. // Runtime type T not accessible from static context. Compile-time error. @@ -66,13 +66,13 @@ class C { // [analyzer] COMPILE_TIME_ERROR.TYPE_PARAMETER_REFERENCED_BY_STATIC // [cfe] Type variables can't be used in static members. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'Type'. // Class '_Type' has no member m: NoSuchMethodError. waldo() => T.m; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm' isn't defined for the class 'Type'. // Runtime type T not accessible from static context. Compile-time error. @@ -81,7 +81,7 @@ class C { // [analyzer] COMPILE_TIME_ERROR.TYPE_PARAMETER_REFERENCED_BY_STATIC // [cfe] Type variables can't be used in static members. // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm' isn't defined for the class 'Type'. } diff --git a/tests/language/type_variable/scope_test.dart b/tests/language/type_variable/scope_test.dart index 86361f29ef7..3be94a3a862 100644 --- a/tests/language/type_variable/scope_test.dart +++ b/tests/language/type_variable/scope_test.dart @@ -24,10 +24,10 @@ class Foo implements I { // [analyzer] COMPILE_TIME_ERROR.TYPE_PARAMETER_REFERENCED_BY_STATIC // [cfe] Type variables can't be used in static members. // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT return new Foo(); // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE } // T is in scope for a factory method. @@ -53,7 +53,7 @@ class Foo implements I { // [cfe] Can only use type variables in instance methods. return new Foo(); // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE } static void set f( @@ -77,7 +77,7 @@ main() { new I(new Foo()); Foo.f1 = new Foo(); // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Foo' can't be assigned to a variable of type 'Foo'. var x = Foo.f; diff --git a/tests/language/unsorted/callable_test.dart b/tests/language/unsorted/callable_test.dart index 75ff4c2cebb..16dde1344b6 100644 --- a/tests/language/unsorted/callable_test.dart +++ b/tests/language/unsorted/callable_test.dart @@ -42,12 +42,12 @@ main() { //^ // [cfe] A value of type 'dynamic Function()' can't be assigned to a variable of type 'dynamic Function(int)'. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT G g0 = y; //^ // [cfe] A value of type 'dynamic Function(int)' can't be assigned to a variable of type 'dynamic Function(String)'. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT Expect.equals(f(), 42); Expect.equals(g(100), 187); diff --git a/tests/language/unsorted/invalid_cast_test.dart b/tests/language/unsorted/invalid_cast_test.dart index c3b7747098d..86666e75a44 100644 --- a/tests/language/unsorted/invalid_cast_test.dart +++ b/tests/language/unsorted/invalid_cast_test.dart @@ -19,47 +19,47 @@ test() { void localFunction(int i) {} List a = []; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'List' can't be assigned to a variable of type 'List'. Map b = {}; // ^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Map' can't be assigned to a variable of type 'Map'. Map c = {}; // ^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Map' can't be assigned to a variable of type 'Map'. int Function(Object) d = (int i) => i; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'int Function(int)' can't be assigned to a variable of type 'int Function(Object)'. D e = new C.fact() as D; D f = new C.fact2() as D; D g = new C.nonFact(); // ^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'C' can't be assigned to a variable of type 'D'. D h = new C.nonFact2(); // ^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'C' can't be assigned to a variable of type 'D'. void Function(Object) i = C.staticFunction; // ^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'void Function(int)' can't be assigned to a variable of type 'void Function(Object)'. void Function(Object) j = topLevelFunction; // ^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function(int)' can't be assigned to a variable of type 'void Function(Object)'. void Function(Object) k = localFunction; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function(int)' can't be assigned to a variable of type 'void Function(Object)'. } diff --git a/tests/language/unsorted/invalid_type_argument_count_test.dart b/tests/language/unsorted/invalid_type_argument_count_test.dart index 3a93da26446..cf9619d4790 100644 --- a/tests/language/unsorted/invalid_type_argument_count_test.dart +++ b/tests/language/unsorted/invalid_type_argument_count_test.dart @@ -5,14 +5,14 @@ // Test top level field. dynamic x1 = 42; // [error line 6, column 1, length 12] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 0 type arguments. class Foo { // Test class member. dynamic x2 = 42; // [error line 13, column 3, length 12] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 0 type arguments. Foo() { @@ -28,7 +28,7 @@ main() { // Test local variable. dynamic x3 = 42; // [error line 29, column 3, length 12] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 0 type arguments. print(x3); @@ -38,7 +38,7 @@ main() { // Test parameter. void foo(dynamic x4) { // [error line 39, column 10, length 12] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 0 type arguments. print(x4); } diff --git a/tests/language/variable/illegal_initializer_test.dart b/tests/language/variable/illegal_initializer_test.dart index 1b99406f89c..6924b691687 100644 --- a/tests/language/variable/illegal_initializer_test.dart +++ b/tests/language/variable/illegal_initializer_test.dart @@ -24,7 +24,7 @@ class B extends A { // ^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER B.c3() : super; // ^ @@ -45,7 +45,7 @@ class B extends A { // ^^^^ // [analyzer] SYNTACTIC_ERROR.MISSING_ASSIGNMENT_IN_INITIALIZER // [error line 39, column 16, length 0] - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Expected '.' before this. // ^ // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN diff --git a/tests/language/variable/ref_before_declaration_test.dart b/tests/language/variable/ref_before_declaration_test.dart index 53f42bcff58..ee9ebc2b12e 100644 --- a/tests/language/variable/ref_before_declaration_test.dart +++ b/tests/language/variable/ref_before_declaration_test.dart @@ -76,7 +76,7 @@ class C { // ^ // [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT } test() { diff --git a/tests/language/variance/syntax/variance_type_parameter_error_syntax_test.dart b/tests/language/variance/syntax/variance_type_parameter_error_syntax_test.dart index 71e14caa2a9..e3e51d37349 100644 --- a/tests/language/variance/syntax/variance_type_parameter_error_syntax_test.dart +++ b/tests/language/variance/syntax/variance_type_parameter_error_syntax_test.dart @@ -17,7 +17,7 @@ void A(out int foo) { // [cfe] Expected ')' before this. List bar; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '<' isn't defined for the class 'Type'. // ^^^ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER @@ -26,7 +26,7 @@ void A(out int foo) { // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN // [cfe] Getter not found: 'out'. // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '>' isn't defined for the class 'Type'. // ^^^ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER diff --git a/tests/language/variance/variance_in_inference_error_test.dart b/tests/language/variance/variance_in_inference_error_test.dart index 1d50ff23cf1..d73f8b07405 100644 --- a/tests/language/variance/variance_in_inference_error_test.dart +++ b/tests/language/variance/variance_in_inference_error_test.dart @@ -32,7 +32,7 @@ main() { var inferredMiddle = inferContraContra(Contravariant(), Contravariant()); upper = inferredMiddle; // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // T <: Upper and T <: Lower. @@ -40,7 +40,7 @@ main() { var inferredLower = inferContraContra(Contravariant(), Contravariant()); upper = inferredLower; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // int <: T <: String is not a valid constraint. @@ -88,7 +88,7 @@ main() { var inferredContraUpper = inferContraBound(ContraBound(Lower(), (Upper x) {})); lower = inferredContraUpper; // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // Inference for Contrabound(...) produces Lower <: T <: Middle. @@ -96,6 +96,6 @@ main() { var inferredContraMiddle = inferContraBound(ContraBound(Lower(), (Middle x) {})); lower = inferredContraMiddle; // ^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. } diff --git a/tests/language/variance/variance_in_subtyping_error_test.dart b/tests/language/variance/variance_in_subtyping_error_test.dart index 9779d33518a..4271fd09320 100644 --- a/tests/language/variance/variance_in_subtyping_error_test.dart +++ b/tests/language/variance/variance_in_subtyping_error_test.dart @@ -70,7 +70,7 @@ main() { List> listLower = [new Contravariant()]; iterableMiddle = listLower; // ^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'List>' can't be assigned to a variable of type 'Iterable>'. testCall(listLower); diff --git a/tests/language/variance/variance_inout_subtyping_error_test.dart b/tests/language/variance/variance_inout_subtyping_error_test.dart index 3bcec37b53b..d994e6c1da7 100644 --- a/tests/language/variance/variance_inout_subtyping_error_test.dart +++ b/tests/language/variance/variance_inout_subtyping_error_test.dart @@ -108,14 +108,14 @@ main() { List> listMiddle = [new Invariant()]; iterableLower = listMiddle; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'List>' can't be assigned to a variable of type 'Iterable>'. Iterable> iterableMiddle = [new Invariant()]; List> listLower = [new Invariant()]; iterableMiddle = listLower; // ^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'List>' can't be assigned to a variable of type 'Iterable>'. testCall(listMiddle); diff --git a/tests/language/variance/variance_out_inference_error_test.dart b/tests/language/variance/variance_out_inference_error_test.dart index 809cdfb44fd..ccce0d1504f 100644 --- a/tests/language/variance/variance_out_inference_error_test.dart +++ b/tests/language/variance/variance_out_inference_error_test.dart @@ -31,7 +31,7 @@ main() { var inferredMiddle = inferCovCov(Covariant(), Covariant()); lower = inferredMiddle; // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // Lower <: T <: Upper. @@ -39,7 +39,7 @@ main() { var inferredUpper = inferCovCov(Covariant(), Covariant()); lower = inferredUpper; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // Inference for Covbound(...) produces Lower <: T <: Upper. @@ -47,7 +47,7 @@ main() { var inferredCovLower = inferCovBound(CovBound(Lower(), (Upper x) {})); upper = inferredCovLower; // ^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // Inference for Covbound(...) produces Lower <: T <: Middle. @@ -55,6 +55,6 @@ main() { var inferredCovLower2 = inferCovBound(CovBound(Lower(), (Middle x) {})); middle = inferredCovLower2; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. } diff --git a/tests/language/variance/variance_out_subtyping_error_test.dart b/tests/language/variance/variance_out_subtyping_error_test.dart index dd925e274ca..2ddcd3e2131 100644 --- a/tests/language/variance/variance_out_subtyping_error_test.dart +++ b/tests/language/variance/variance_out_subtyping_error_test.dart @@ -70,7 +70,7 @@ main() { List> listMiddle = [new Covariant()]; iterableLower = listMiddle; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'List>' can't be assigned to a variable of type 'Iterable>'. testCall(listMiddle); diff --git a/tests/language/variance/variance_upper_lower_bounds_error_test.dart b/tests/language/variance/variance_upper_lower_bounds_error_test.dart index 2c69097d9cf..a8e1f25d021 100644 --- a/tests/language/variance/variance_upper_lower_bounds_error_test.dart +++ b/tests/language/variance/variance_upper_lower_bounds_error_test.dart @@ -28,39 +28,39 @@ main() { exactly(condition ? Contravariant() : Contravariant()); Exactly> contraUpperExpected = contraLowerActual; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var contraMiddleActual = exactly(condition ? Contravariant() : Contravariant()); contraUpperExpected = contraMiddleActual; // ^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var covMiddleActual = exactly(condition ? Covariant() : Covariant()); Exactly> covLowerExpected = covMiddleActual; // ^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var covUpperActual = exactly(condition ? Covariant() : Covariant()); covLowerExpected = covUpperActual; // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var invObjectActual = exactly(condition ? Invariant() : Invariant()); Exactly> invMiddleExpected = invObjectActual; // ^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly>'. Exactly> invUpperExpected = invObjectActual; // ^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly>'. var legacyCovMiddleActual = @@ -68,14 +68,14 @@ main() { Exactly> legacyCovLowerExpected = legacyCovMiddleActual; // ^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var legacyCovUpperActual = exactly(condition ? LegacyCovariant() : LegacyCovariant()); legacyCovLowerExpected = legacyCovUpperActual; // ^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var multiActual = exactly(condition @@ -83,20 +83,20 @@ main() { : Multi()); Exactly> multiExpected = multiActual; // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var multiActual2 = exactly( condition ? Multi() : Multi()); Exactly> multiObjectExpected = multiActual2; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly>'. var multiActual3 = exactly( condition ? Multi() : Multi()); Exactly multiObjectExpected2 = multiActual3; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly'. } diff --git a/tests/language_2/assert/initializer_const_function_test.dart b/tests/language_2/assert/initializer_const_function_test.dart index 27b99bddd80..b581c1dd3df 100644 --- a/tests/language_2/assert/initializer_const_function_test.dart +++ b/tests/language_2/assert/initializer_const_function_test.dart @@ -11,7 +11,7 @@ class C { const C.bc01(this.x, y) : assert(staticTrue) // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_EXPRESSION // [cfe] A value of type 'bool Function()' can't be assigned to a variable of type 'bool'. ; } diff --git a/tests/language_2/assign/static_type_test.dart b/tests/language_2/assign/static_type_test.dart index d184bf4c1c0..8fba36d2135 100644 --- a/tests/language_2/assign/static_type_test.dart +++ b/tests/language_2/assign/static_type_test.dart @@ -7,7 +7,7 @@ int a = "String"; // ^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. class A { @@ -16,19 +16,19 @@ class A { // [analyzer] CHECKED_MODE_COMPILE_TIME_ERROR.VARIABLE_TYPE_MISMATCH // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT final int d = "String"; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. int e = "String"; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. A() { int f = "String"; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. } method( @@ -36,7 +36,7 @@ class A { int g = "String"]) { // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. return g; } diff --git a/tests/language_2/async/congruence_local_test.dart b/tests/language_2/async/congruence_local_test.dart index 8d8a03d974d..de5fbaa22d8 100644 --- a/tests/language_2/async/congruence_local_test.dart +++ b/tests/language_2/async/congruence_local_test.dart @@ -102,7 +102,7 @@ main() { Future v1 = f_inferred_futureObject(); int v2 = f_inferred_futureObject(); // ^^^^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Future' can't be assigned to a variable of type 'int'. @@ -112,7 +112,7 @@ main() { Future v3 = f_inferred_A(); Future v4 = f_inferred_A(); // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Future' can't be assigned to a variable of type 'Future'. } diff --git a/tests/language_2/async/congruence_method_test.dart b/tests/language_2/async/congruence_method_test.dart index 69f63d717c9..e9511035817 100644 --- a/tests/language_2/async/congruence_method_test.dart +++ b/tests/language_2/async/congruence_method_test.dart @@ -80,7 +80,7 @@ void checkStaticTypes(C c) { Future v1 = c.f_inferred_A(); Future v2 = c.f_inferred_A(); // ^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Future' can't be assigned to a variable of type 'Future'. } diff --git a/tests/language_2/async/congruence_unnamed_test.dart b/tests/language_2/async/congruence_unnamed_test.dart index 5e5ccd2556a..ecc2964febd 100644 --- a/tests/language_2/async/congruence_unnamed_test.dart +++ b/tests/language_2/async/congruence_unnamed_test.dart @@ -122,7 +122,7 @@ main() { Future v1 = f_inferred_futureObject(); int v2 = f_inferred_futureObject(); // ^^^^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Future' can't be assigned to a variable of type 'int'. @@ -132,7 +132,7 @@ main() { Future v3 = f_inferred_A(); Future v4 = f_inferred_A(); // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Future' can't be assigned to a variable of type 'Future'. } diff --git a/tests/language_2/async/or_generator_return_type_stacktrace_test.dart b/tests/language_2/async/or_generator_return_type_stacktrace_test.dart index 1de0f9c8051..a6de93676a1 100644 --- a/tests/language_2/async/or_generator_return_type_stacktrace_test.dart +++ b/tests/language_2/async/or_generator_return_type_stacktrace_test.dart @@ -6,7 +6,7 @@ import "package:expect/expect.dart"; int badReturnTypeAsync() async {} // [error line 7, column 1, length 3] -// [analyzer] STATIC_TYPE_WARNING.ILLEGAL_ASYNC_RETURN_TYPE +// [analyzer] COMPILE_TIME_ERROR.ILLEGAL_ASYNC_RETURN_TYPE // ^ // [cfe] Functions marked 'async' must have a return type assignable to 'Future'. int badReturnTypeAsyncStar() async* {} diff --git a/tests/language_2/async/return_types_test.dart b/tests/language_2/async/return_types_test.dart index 4ecd5b49b61..66853a73789 100644 --- a/tests/language_2/async/return_types_test.dart +++ b/tests/language_2/async/return_types_test.dart @@ -18,13 +18,13 @@ Future foo3() async { return "String"; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'Future' can't be assigned to a variable of type 'FutureOr'. } Future // [error line 25, column 1, length 19] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. foo4() async { return "String"; @@ -32,7 +32,7 @@ foo4() async { int // [error line 33, column 1, length 3] -// [analyzer] STATIC_TYPE_WARNING.ILLEGAL_ASYNC_RETURN_TYPE +// [analyzer] COMPILE_TIME_ERROR.ILLEGAL_ASYNC_RETURN_TYPE foo5() async { // [error line 36, column 1] // [cfe] Functions marked 'async' must have a return type assignable to 'Future'. @@ -48,7 +48,7 @@ Future> foo7() async { return new Future.value(3); // ^^^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE } Iterable foo8() sync* { diff --git a/tests/language_2/call/non_method_field_test.dart b/tests/language_2/call/non_method_field_test.dart index 8fbd2a95a54..8656cbf72de 100644 --- a/tests/language_2/call/non_method_field_test.dart +++ b/tests/language_2/call/non_method_field_test.dart @@ -14,14 +14,14 @@ main() { Fisk x1 = new Fisk(); x1.i(); //^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] 'i' isn't a function or method and can't be invoked. Hest x2 = new Hest(); x2.i(); //^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] 'i' isn't a function or method and can't be invoked. } diff --git a/tests/language_2/call/object_has_no_call_method_test.dart b/tests/language_2/call/object_has_no_call_method_test.dart index dcb2a5c1e3d..d02b290cc4a 100644 --- a/tests/language_2/call/object_has_no_call_method_test.dart +++ b/tests/language_2/call/object_has_no_call_method_test.dart @@ -6,20 +6,20 @@ void test(dynamic d, Object o, Function f) { d(); o(); //^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'Object'. f(); d.call; o.call; //^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'call' isn't defined for the class 'Object'. f.call; d.call(); o.call(); //^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'call' isn't defined for the class 'Object'. f.call(); } diff --git a/tests/language_2/call/through_getter_test.dart b/tests/language_2/call/through_getter_test.dart index 2169e8c6996..06e5af32b32 100644 --- a/tests/language_2/call/through_getter_test.dart +++ b/tests/language_2/call/through_getter_test.dart @@ -31,12 +31,12 @@ class CallThroughGetterTest { TOP_LEVEL_CONST(); // ^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. (TOP_LEVEL_CONST)(); // ^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } diff --git a/tests/language_2/cascade/cascade_test.dart b/tests/language_2/cascade/cascade_test.dart index 274b23bf5dd..7e674f50ae7 100644 --- a/tests/language_2/cascade/cascade_test.dart +++ b/tests/language_2/cascade/cascade_test.dart @@ -93,11 +93,11 @@ main() { // [analyzer] SYNTACTIC_ERROR.MISSING_IDENTIFIER // [cfe] Expected an identifier, but got '37'. // [error line 91, column 8, length 0] - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER a.."foo"; // ^^^^^ // [analyzer] SYNTACTIC_ERROR.MISSING_IDENTIFIER // [cfe] Expected an identifier, but got '"foo"'. // [error line 97, column 11, length 0] - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER } diff --git a/tests/language_2/closure/internals_test.dart b/tests/language_2/closure/internals_test.dart index 78f04ab6a32..9efdda3896a 100644 --- a/tests/language_2/closure/internals_test.dart +++ b/tests/language_2/closure/internals_test.dart @@ -12,14 +12,14 @@ main() { var f = new C().foo; var target = f.target; // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'target' isn't defined for the class 'dynamic Function()'. var self = f.self; // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'self' isn't defined for the class 'dynamic Function()'. var receiver = f.receiver; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'receiver' isn't defined for the class 'dynamic Function()'. } diff --git a/tests/language_2/compile_time_constant/static2_test.dart b/tests/language_2/compile_time_constant/static2_test.dart index 5de087a0336..e38358af28c 100644 --- a/tests/language_2/compile_time_constant/static2_test.dart +++ b/tests/language_2/compile_time_constant/static2_test.dart @@ -13,7 +13,7 @@ class A { const A.a2(this.x); const A.a3([this.x = 'foo']); // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. const A.a4(String this.x); // ^^^^^^^^^^^^^ diff --git a/tests/language_2/compile_time_constant/static3_test.dart b/tests/language_2/compile_time_constant/static3_test.dart index d6c508bf2a0..612aeb7e799 100644 --- a/tests/language_2/compile_time_constant/static3_test.dart +++ b/tests/language_2/compile_time_constant/static3_test.dart @@ -13,7 +13,7 @@ class A { const A.a2(this.x); const A.a3([this.x = 'foo']); // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. const A.a4(String this.x); // ^^^^^^^^^^^^^ diff --git a/tests/language_2/compile_time_constant/static_test.dart b/tests/language_2/compile_time_constant/static_test.dart index 288ffef3d2e..a7fb0a8a36f 100644 --- a/tests/language_2/compile_time_constant/static_test.dart +++ b/tests/language_2/compile_time_constant/static_test.dart @@ -4,17 +4,17 @@ final int x = 'foo'; // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. const int y = 'foo'; // ^^^^^ // [analyzer] CHECKED_MODE_COMPILE_TIME_ERROR.VARIABLE_TYPE_MISMATCH // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT int z = 'foo'; // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. main() { diff --git a/tests/language_2/const/conditional_test.dart b/tests/language_2/const/conditional_test.dart index 33aec86bd93..49437481aad 100644 --- a/tests/language_2/const/conditional_test.dart +++ b/tests/language_2/const/conditional_test.dart @@ -73,13 +73,13 @@ const cond4 = zeroConst ? const0 : const1; // [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_TYPE_BOOL // [cfe] A value of type 'int' can't be assigned to a variable of type 'bool'. // ^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION const cond4a = zeroConst ? nonConst : const1; // ^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_TYPE_BOOL // [cfe] A value of type 'int' can't be assigned to a variable of type 'bool'. // ^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // ^ // [cfe] Not a constant expression. const cond4b = zeroConst ? const0 : nonConst; @@ -87,7 +87,7 @@ const cond4b = zeroConst ? const0 : nonConst; // [analyzer] COMPILE_TIME_ERROR.CONST_EVAL_TYPE_BOOL // [cfe] A value of type 'int' can't be assigned to a variable of type 'bool'. // ^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_CONDITION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_CONDITION // ^ // [cfe] Not a constant expression. diff --git a/tests/language_2/const/init2_test.dart b/tests/language_2/const/init2_test.dart index 7f5e1a32c95..40b7a8bb5ae 100644 --- a/tests/language_2/const/init2_test.dart +++ b/tests/language_2/const/init2_test.dart @@ -9,7 +9,7 @@ const double d = intValue; // [analyzer] CHECKED_MODE_COMPILE_TIME_ERROR.VARIABLE_TYPE_MISMATCH // [cfe] A value of type 'int' can't be assigned to a variable of type 'double'. // ^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT +// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT main() { print(c); diff --git a/tests/language_2/constructor/named_constructor_test.dart b/tests/language_2/constructor/named_constructor_test.dart index d802b9a6cab..3b8af32ad48 100644 --- a/tests/language_2/constructor/named_constructor_test.dart +++ b/tests/language_2/constructor/named_constructor_test.dart @@ -24,12 +24,12 @@ void main() { // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // 'Class.named' doesn't fit the grammar syntax T.id: new Class.named().value; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. new prefix.Class().value; @@ -45,7 +45,7 @@ void main() { // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // [cfe] Method not found: 'prefix.Class'. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. new prefix.Class.named().value; @@ -64,7 +64,7 @@ void main() { // 'prefix.Class.named' doesn't fit the grammar syntax T.id: new prefix.Class.named().value; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. // 'prefix.Class' doesn't fit the grammar syntax T.id: @@ -73,7 +73,7 @@ void main() { // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // [cfe] Method not found: 'prefix.Class'. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. @@ -90,7 +90,7 @@ void main() { // 'prefix.Class.named' doesn't fit the grammar syntax T.id: new prefix.Class.named().value; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. // 'prefix.Class.named' doesn't fit the grammar syntax T.id: @@ -99,6 +99,6 @@ void main() { // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // [cfe] Method not found: 'prefix.Class'. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. } diff --git a/tests/language_2/constructor/reference_test.dart b/tests/language_2/constructor/reference_test.dart index c1ec04c7681..9246d2b8f11 100644 --- a/tests/language_2/constructor/reference_test.dart +++ b/tests/language_2/constructor/reference_test.dart @@ -23,13 +23,13 @@ main() { // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN // [cfe] Expected '(' after this. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'baz' isn't defined for the class 'Foo'. new Foo.bar(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR new Foo.bar.baz(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. @@ -41,7 +41,7 @@ main() { // ^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // ^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^ // [cfe] Method not found: 'Foo.bar.baz'. @@ -60,13 +60,13 @@ main() { // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN // [cfe] Expected '(' after this. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'baz' isn't defined for the class 'Foo'. const Foo.bar(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR const Foo.bar.baz(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. @@ -78,7 +78,7 @@ main() { // ^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // ^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^ // [cfe] Method not found: 'Foo.bar.baz'. @@ -87,7 +87,7 @@ main() { Foo.bar(); Foo.bar.baz(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Getter not found: 'bar'. Foo(); Foo.bar(); @@ -96,13 +96,13 @@ main() { // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN // [cfe] Expected '(' after this. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'baz' isn't defined for the class 'Foo'. Foo.bar(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR Foo.bar.baz(); // ^ // [cfe] A constructor invocation can't have type arguments on the constructor name. @@ -112,6 +112,6 @@ main() { // [cfe] Method not found: 'Foo.bar.baz'. Foo.bar.baz(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Getter not found: 'bar'. } diff --git a/tests/language_2/deferred/super_dependency_test.dart b/tests/language_2/deferred/super_dependency_test.dart index f49380cea18..5879e5667a0 100644 --- a/tests/language_2/deferred/super_dependency_test.dart +++ b/tests/language_2/deferred/super_dependency_test.dart @@ -8,7 +8,7 @@ import "package:expect/expect.dart"; // ^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_SETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_SETTER // [cfe] Superclass has no setter named 'foo'. import "super_dependency_lib.dart" deferred as lib; diff --git a/tests/language_2/enum/private_test.dart b/tests/language_2/enum/private_test.dart index bd99d849eed..a24fec36e23 100644 --- a/tests/language_2/enum/private_test.dart +++ b/tests/language_2/enum/private_test.dart @@ -20,6 +20,6 @@ main() { Expect.equals('Enum2._A,Enum2._B', Enum2.values.join(',')); Expect.throwsNoSuchMethodError(() => Enum2._A); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_ENUM_CONSTANT + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_ENUM_CONSTANT // [cfe] Getter not found: '_A'. } diff --git a/tests/language_2/extension_methods/static_extension_bounds_error_test.dart b/tests/language_2/extension_methods/static_extension_bounds_error_test.dart index 5e8ae34c106..2dc6ba088a3 100644 --- a/tests/language_2/extension_methods/static_extension_bounds_error_test.dart +++ b/tests/language_2/extension_methods/static_extension_bounds_error_test.dart @@ -32,7 +32,7 @@ void main() { // Inferred type of String does not satisfy the bound. s.e1; // ^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'e1' isn't defined for the class 'String'. E1(s).e1; //^^ @@ -56,7 +56,7 @@ void main() { // Inferred type of String does not satisfy the bound. s.e2; // ^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'e2' isn't defined for the class 'String'. E2(s).e2; //^^ @@ -123,7 +123,7 @@ void main() { // Inferred super-bounded type is invalid as type argument superRec.e4; // ^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'e4' isn't defined for the class 'Rec'. E4(superRec).e4; //^^ diff --git a/tests/language_2/extension_methods/static_extension_deferred_import_resolution_error_test.dart b/tests/language_2/extension_methods/static_extension_deferred_import_resolution_error_test.dart index 59920e77c20..8dc19f1bcd1 100644 --- a/tests/language_2/extension_methods/static_extension_deferred_import_resolution_error_test.dart +++ b/tests/language_2/extension_methods/static_extension_deferred_import_resolution_error_test.dart @@ -10,10 +10,10 @@ void main() { Object o = 1; OnObject(o).onObject; //^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION // [cfe] Method not found: 'OnObject'. o.onObject; //^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'onObject' isn't defined for the class 'Object'. } diff --git a/tests/language_2/extension_methods/static_extension_getter_setter_conflicts_test.dart b/tests/language_2/extension_methods/static_extension_getter_setter_conflicts_test.dart index 8493792eb46..4986f453bf7 100644 --- a/tests/language_2/extension_methods/static_extension_getter_setter_conflicts_test.dart +++ b/tests/language_2/extension_methods/static_extension_getter_setter_conflicts_test.dart @@ -44,15 +44,15 @@ void test0() { c0.m2 = 0; c0.m2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm2' isn't defined for the class 'C0'. c0.m2 += 0; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm2' isn't defined for the class 'C0'. c0.m2++; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm2' isn't defined for the class 'C0'. E0(c0).m2; @@ -60,7 +60,7 @@ void test0() { c0[0]; c0[0] = 0; //^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C0'. E0(c0)[0]; // ^^^ @@ -70,11 +70,11 @@ void test0() { c0[0] += 0; //^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C0'. c0[0]++; //^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C0'. E0(c0)[0] += 0; @@ -114,24 +114,24 @@ void test1() { c1a.m2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm2' isn't defined for the class 'C1'. c1a.m2 = 0; c1a[0] = 0; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C1'. c1a[0] += 0; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C1'. c1a[0]++; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'C1'. c1a[0]; @@ -218,23 +218,23 @@ extension E2 on C2 { this.m2 = 0; this.m2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm2' isn't defined for the class 'C2'. this[0] = 0; this[0]; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'C2'. this[0] += 0; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'C2'. this[0]++; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'C2'. // Check that `this.mc` refers to `C2.mc`. diff --git a/tests/language_2/extension_methods/static_extension_import_hide_error_test.dart b/tests/language_2/extension_methods/static_extension_import_hide_error_test.dart index 9a93aa00625..25b0461ac7d 100644 --- a/tests/language_2/extension_methods/static_extension_import_hide_error_test.dart +++ b/tests/language_2/extension_methods/static_extension_import_hide_error_test.dart @@ -12,7 +12,7 @@ void main() { Object o = i; i.onInt; //^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'onInt' isn't defined for the class 'int'. i.onObject; o.onObject; diff --git a/tests/language_2/extension_methods/static_extension_import_prefixed_hide_error_test.dart b/tests/language_2/extension_methods/static_extension_import_prefixed_hide_error_test.dart index 3c485e83465..a146f12d75f 100644 --- a/tests/language_2/extension_methods/static_extension_import_prefixed_hide_error_test.dart +++ b/tests/language_2/extension_methods/static_extension_import_prefixed_hide_error_test.dart @@ -12,7 +12,7 @@ void main() { Object o = i; i.onInt; //^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'onInt' isn't defined for the class 'int'. i.onObject; o.onObject; diff --git a/tests/language_2/extension_methods/static_extension_internal_basename_shadowing_error_test.dart b/tests/language_2/extension_methods/static_extension_internal_basename_shadowing_error_test.dart index f1a92549f61..86941bece2e 100644 --- a/tests/language_2/extension_methods/static_extension_internal_basename_shadowing_error_test.dart +++ b/tests/language_2/extension_methods/static_extension_internal_basename_shadowing_error_test.dart @@ -51,7 +51,7 @@ extension E1 on A1 { // The instance getter shadows the global method topLevelMethod(4); // ^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } @@ -143,7 +143,7 @@ extension E3 on A3 { // The static getter shadows the global method topLevelMethod(4); // ^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } @@ -225,7 +225,7 @@ extension E6 on A6 { // The instance getter shadows the other extensions method extensionMethod(4); // ^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } @@ -256,7 +256,7 @@ class A7 extends A6 { // The instance getter shadows the other extensions method extensionMethod(4); // ^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] 'extensionMethod' isn't a function or method and can't be invoked. } @@ -371,7 +371,7 @@ extension E10 on A10 { // The static getter shadows the other extensions method extensionMethod(4); // ^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } @@ -417,7 +417,7 @@ class A11 extends A10 { // The static getter shadows the other extensions method extensionMethod(4); // ^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'int'. } diff --git a/tests/language_2/extension_methods/static_extension_internal_resolution_6_error_test.dart b/tests/language_2/extension_methods/static_extension_internal_resolution_6_error_test.dart index 38191b85788..dd18be32e8e 100644 --- a/tests/language_2/extension_methods/static_extension_internal_resolution_6_error_test.dart +++ b/tests/language_2/extension_methods/static_extension_internal_resolution_6_error_test.dart @@ -29,7 +29,7 @@ extension GenericExtension on T { void shadowTypeParam(T x) { T y = self; // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type '#T' can't be assigned to a variable of type 'T'. } diff --git a/tests/language_2/extension_methods/static_extension_resolution_failures_test.dart b/tests/language_2/extension_methods/static_extension_resolution_failures_test.dart index 2856a18899e..ce822ac58ad 100644 --- a/tests/language_2/extension_methods/static_extension_resolution_failures_test.dart +++ b/tests/language_2/extension_methods/static_extension_resolution_failures_test.dart @@ -39,7 +39,7 @@ main() { // No `i_num` extension declared. i_num.i_num; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'i_num' isn't defined for the class 'Iterable'. Expect.equals("Iterable.i_num", ii.i_num); diff --git a/tests/language_2/factory/factory_test.dart b/tests/language_2/factory/factory_test.dart index d7b5c2dbc71..5431241c1ca 100644 --- a/tests/language_2/factory/factory_test.dart +++ b/tests/language_2/factory/factory_test.dart @@ -36,7 +36,7 @@ class FactoryTest { abstract class Link { factory Link.create() = LinkFactory.create; // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 0 type arguments. // ^^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.REDIRECT_TO_INVALID_RETURN_TYPE diff --git a/tests/language_2/factory/return_type_checked_test.dart b/tests/language_2/factory/return_type_checked_test.dart index c882f4fe132..76e6f3a19fa 100644 --- a/tests/language_2/factory/return_type_checked_test.dart +++ b/tests/language_2/factory/return_type_checked_test.dart @@ -7,7 +7,7 @@ import "package:expect/expect.dart"; class A { factory A() => 42; // ^^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE // [cfe] A value of type 'int' can't be assigned to a variable of type 'A'. } diff --git a/tests/language_2/field/type_check_test.dart b/tests/language_2/field/type_check_test.dart index 51f03fcceb2..c27d3d597a3 100644 --- a/tests/language_2/field/type_check_test.dart +++ b/tests/language_2/field/type_check_test.dart @@ -9,6 +9,6 @@ class A { int main() { new A().e = "String"; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. } diff --git a/tests/language_2/function/malformed_result_type_test.dart b/tests/language_2/function/malformed_result_type_test.dart index 3b0257b05a2..d149be534d4 100644 --- a/tests/language_2/function/malformed_result_type_test.dart +++ b/tests/language_2/function/malformed_result_type_test.dart @@ -11,6 +11,6 @@ class C {} main() { C f() => null; //^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. } diff --git a/tests/language_2/function/type_call_getter2_test.dart b/tests/language_2/function/type_call_getter2_test.dart index c52cb9ea4d4..789f22eedb6 100644 --- a/tests/language_2/function/type_call_getter2_test.dart +++ b/tests/language_2/function/type_call_getter2_test.dart @@ -27,42 +27,42 @@ main() { Function a2 = a; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A' can't be assigned to a variable of type 'Function'. final F a3 = a; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A' can't be assigned to a variable of type 'int Function(String)'. final Function b2 = b; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'B' can't be assigned to a variable of type 'Function'. final F b3 = b; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'B' can't be assigned to a variable of type 'int Function(String)'. final Function c2 = c; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'C' can't be assigned to a variable of type 'Function'. final F c3 = c; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'C' can't be assigned to a variable of type 'int Function(String)'. Expect.throwsTypeError(() { diff --git a/tests/language_2/generic/field_mixin6_test.dart b/tests/language_2/generic/field_mixin6_test.dart index 47a367819f1..303df88354b 100644 --- a/tests/language_2/generic/field_mixin6_test.dart +++ b/tests/language_2/generic/field_mixin6_test.dart @@ -9,7 +9,7 @@ import 'package:expect/expect.dart'; class M { T field1 = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'int' can't be assigned to a variable of type 'T'. T field2 = 0 as dynamic; } diff --git a/tests/language_2/generic/function_subtype_parametrized_typedef_test.dart b/tests/language_2/generic/function_subtype_parametrized_typedef_test.dart index a1dd7910277..10775ef0c15 100644 --- a/tests/language_2/generic/function_subtype_parametrized_typedef_test.dart +++ b/tests/language_2/generic/function_subtype_parametrized_typedef_test.dart @@ -17,30 +17,30 @@ void foo(H ha, H hb, H hc) { H haa = ha; H hab = hb; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hac = hc; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hba = ha; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hbb = hb; H hbc = hc; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hca = ha; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hcb = hb; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. H hcc = hc; } diff --git a/tests/language_2/generic/function_subtype_test.dart b/tests/language_2/generic/function_subtype_test.dart index 28cb90ac912..d392f6da96b 100644 --- a/tests/language_2/generic/function_subtype_test.dart +++ b/tests/language_2/generic/function_subtype_test.dart @@ -14,12 +14,12 @@ void foo() { F1 f11 = f1; F1 f12 = f2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. F2 f21 = f1; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'void Function()' can't be assigned to a variable of type 'void Function()'. F2 f22 = f2; } diff --git a/tests/language_2/generic/function_typedef2_test.dart b/tests/language_2/generic/function_typedef2_test.dart index 5a3207f12c7..704a8247056 100644 --- a/tests/language_2/generic/function_typedef2_test.dart +++ b/tests/language_2/generic/function_typedef2_test.dart @@ -27,7 +27,7 @@ typedef J = List; // [cfe] Can't create typedef from non-function type. typedef K = Function(Function(A)); // ^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Can't use type arguments with type variable 'A'. typedef L = Function({x}); // ^ diff --git a/tests/language_2/generic/wrong_number_type_arguments_test.dart b/tests/language_2/generic/wrong_number_type_arguments_test.dart index 69a0b6829d1..53e962798d6 100644 --- a/tests/language_2/generic/wrong_number_type_arguments_test.dart +++ b/tests/language_2/generic/wrong_number_type_arguments_test.dart @@ -5,18 +5,18 @@ // Map takes 2 type arguments. Map foo; // [error line 6, column 1, length 11] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. Map baz; // [error line 10, column 1, length 11] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. main() { foo = null; var bar = new Map(); // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. baz = new Map(); } diff --git a/tests/language_2/getter/no_setter2_test.dart b/tests/language_2/getter/no_setter2_test.dart index 83d92c4b583..22ad07ef3c8 100644 --- a/tests/language_2/getter/no_setter2_test.dart +++ b/tests/language_2/getter/no_setter2_test.dart @@ -18,7 +18,7 @@ class Example { // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_NO_SETTER // [cfe] The getter 'nextVar' isn't defined for the class 'Example'. // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER + // [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // [cfe] The setter 'nextVar' isn't defined for the class 'Example'. } static test() { @@ -31,7 +31,7 @@ class Example { // [analyzer] COMPILE_TIME_ERROR.INVALID_REFERENCE_TO_THIS // [cfe] Expected identifier, but got 'this'. // ^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER +// [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // ^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_NO_SETTER } diff --git a/tests/language_2/getter/no_setter_test.dart b/tests/language_2/getter/no_setter_test.dart index c403d327022..260b5fcfc49 100644 --- a/tests/language_2/getter/no_setter_test.dart +++ b/tests/language_2/getter/no_setter_test.dart @@ -15,7 +15,7 @@ class Example { // [cfe] Setter not found: 'nextVar'. this.nextVar = 1; // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER + // [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // [cfe] The setter 'nextVar' isn't defined for the class 'Example'. // ^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_NO_SETTER @@ -30,7 +30,7 @@ class Example { // [analyzer] COMPILE_TIME_ERROR.INVALID_REFERENCE_TO_THIS // [cfe] Expected identifier, but got 'this'. // ^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER +// [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // ^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_FINAL_NO_SETTER } diff --git a/tests/language_2/getter/setter2_test.dart b/tests/language_2/getter/setter2_test.dart index ab9ba5a6b6e..a533c411563 100644 --- a/tests/language_2/getter/setter2_test.dart +++ b/tests/language_2/getter/setter2_test.dart @@ -74,7 +74,7 @@ main() { // Type 'A' has no method named 'b' instance1.field.b(); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'b' isn't defined for the class 'A'. instance3.field = new B(); diff --git a/tests/language_2/identifier/known_prefix_error_test.dart b/tests/language_2/identifier/known_prefix_error_test.dart index fe1ea19f32e..06ec097359f 100644 --- a/tests/language_2/identifier/known_prefix_error_test.dart +++ b/tests/language_2/identifier/known_prefix_error_test.dart @@ -72,82 +72,82 @@ yield _yield = new yield.A(); async.B _B_async = new async.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'async' isn't a type. await.B _B_await = new await.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'await' isn't a type. hide.B _B_hide = new hide.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'hide' isn't a type. of.B _B_of = new of.B(); // ^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'of' isn't a type. on.B _B_on = new on.B(); // ^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'on' isn't a type. show.B _B_show = new show.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'show' isn't a type. sync.B _B_sync = new sync.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'sync' isn't a type. yield.B _B_yield = new yield.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'yield' isn't a type. async.B> _B2_async = new async.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'async' isn't a type. // ^ // [cfe] Expected 0 type arguments. await.B> _B2_await = new await.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'await' isn't a type. // ^ // [cfe] Expected 0 type arguments. hide.B> _B2_hide = new hide.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'hide' isn't a type. // ^ // [cfe] Expected 0 type arguments. of.B> _B2_of = new of.B(); // ^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'of' isn't a type. // ^ // [cfe] Expected 0 type arguments. on.B> _B2_on = new on.B(); // ^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'on' isn't a type. // ^ // [cfe] Expected 0 type arguments. show.B> _B2_show = new show.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'show' isn't a type. // ^ // [cfe] Expected 0 type arguments. sync.B> _B2_sync = new sync.B(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'sync' isn't a type. // ^ // [cfe] Expected 0 type arguments. yield.B> _B2_yield = new yield.B(); // ^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'yield' isn't a type. // ^ // [cfe] Expected 0 type arguments. diff --git a/tests/language_2/if_null/assignment_behavior_test.dart b/tests/language_2/if_null/assignment_behavior_test.dart index 99811f284a2..6b027791eaf 100644 --- a/tests/language_2/if_null/assignment_behavior_test.dart +++ b/tests/language_2/if_null/assignment_behavior_test.dart @@ -214,11 +214,11 @@ main() { check(1, () => C?.x ??= bad(), ['C.x']); h.C.xgetValue = 1; // ^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] Setter not found: 'xgetValue'. check(1, () => h.c?.x ??= bad(), ['h.C.x']); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_PREFIXED_NAME + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_PREFIXED_NAME // [cfe] Getter not found: 'c'. yGetValue = 1; check(1, () => C?.x ??= y, ['C.x', 'y', 'C.x=1']); diff --git a/tests/language_2/if_null/precedence_test.dart b/tests/language_2/if_null/precedence_test.dart index cb419fc4398..224238f8719 100644 --- a/tests/language_2/if_null/precedence_test.dart +++ b/tests/language_2/if_null/precedence_test.dart @@ -29,7 +29,7 @@ main() { // "(a ?? b) || c" would allow b to have any type provided that a is bool. false ?? 1 || true; // ^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'int' can't be assigned to a variable of type 'bool'. // "a || b ?? c" should parse as "(a || b) ?? c", therefore it is a static @@ -37,7 +37,7 @@ main() { // "a || (b ?? c)" would allow b to have any type provided that c is bool. false || 1 ?? true; // ^ - // [analyzer] STATIC_TYPE_WARNING.NON_BOOL_OPERAND + // [analyzer] COMPILE_TIME_ERROR.NON_BOOL_OPERAND // [cfe] A value of type 'int' can't be assigned to a variable of type 'bool'. // An incorrect parse of "a || (b ?? c)" would result in no checked-mode diff --git a/tests/language_2/import/self_test.dart b/tests/language_2/import/self_test.dart index 1feeb8811d4..f724a601d05 100644 --- a/tests/language_2/import/self_test.dart +++ b/tests/language_2/import/self_test.dart @@ -18,6 +18,6 @@ var _x = "The quick brown fox jumps over the dazy log"; main() { p._x; //^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_PREFIXED_NAME + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_PREFIXED_NAME // [cfe] Getter not found: '_x'. } diff --git a/tests/language_2/inference/accessor_ref_test.dart b/tests/language_2/inference/accessor_ref_test.dart index 8f16f8b3bca..ec80b1449ff 100644 --- a/tests/language_2/inference/accessor_ref_test.dart +++ b/tests/language_2/inference/accessor_ref_test.dart @@ -35,14 +35,14 @@ test() { x = new E(); x = new B(); // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'B' can't be assigned to a variable of type 'C'. y = new C(); y = new E(); y = new B(); // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'B' can't be assigned to a variable of type 'C'. } diff --git a/tests/language_2/least_upper_bound/expansive_test.dart b/tests/language_2/least_upper_bound/expansive_test.dart index d798b1520c4..970b685b06e 100644 --- a/tests/language_2/least_upper_bound/expansive_test.dart +++ b/tests/language_2/least_upper_bound/expansive_test.dart @@ -42,37 +42,37 @@ void testC1(bool z, C1 a, N> b) { // Is least upper bound dynamic? (z ? a : b).z; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'z' isn't defined for the class 'Object'. // Is least upper bound N<...> ? (z ? a : b).n; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound C1<...> ? (z ? a : b).c1; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c1' isn't defined for the class 'Object'. // Is least upper bound N ? (z ? a : b).n.z; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound N> ? (z ? a : b).n.n; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound N> ? (z ? a : b).n.c1; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. } } @@ -106,37 +106,37 @@ void testC2(bool z, C2 a, N> b) { // Is least upper bound dynamic? (z ? a : b).z; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'z' isn't defined for the class 'Object'. // Is least upper bound N<...> ? (z ? a : b).n; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound C2<...> ? (z ? a : b).c2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c2' isn't defined for the class 'Object'. // Is least upper bound N ? (z ? a : b).n.z; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound N> ? (z ? a : b).n.n; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. // Is least upper bound N> ? (z ? a : b).n.c2; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'n' isn't defined for the class 'Object'. } } diff --git a/tests/language_2/least_upper_bound/least_upper_bound_test.dart b/tests/language_2/least_upper_bound/least_upper_bound_test.dart index 4815316eb68..4a7a784c9db 100644 --- a/tests/language_2/least_upper_bound/least_upper_bound_test.dart +++ b/tests/language_2/least_upper_bound/least_upper_bound_test.dart @@ -47,11 +47,11 @@ void testAB(A a, B b) { B r2 = false ? a : b; (true ? a : b).a = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'a' isn't defined for the class 'Object'. (false ? a : b).b = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'b' isn't defined for the class 'Object'. var c = new C(); (true ? a as dynamic : c).a = 0; @@ -64,7 +64,7 @@ void testBC(B b, C c) { (true ? b : c).b = 0; (false ? b : c).c = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'c' isn't defined for the class 'B'. var a = null; (true ? b : a).b = 0; @@ -80,11 +80,11 @@ void testCD(C c, D d) { (false ? c : d).b = 0; (true ? c : d).c = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'c' isn't defined for the class 'B'. (false ? c : d).d = 0; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'd' isn't defined for the class 'B'. } @@ -94,12 +94,12 @@ void testEE(E e, E f) { F r2 = false ? e : f; A r3 = true ? e : f; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'A'. B r4 = false ? e : f; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'B'. (true ? e : f).e = null; @@ -112,18 +112,18 @@ void testEF(E e, F f) { F r2 = false ? e : f; A r3 = true ? e : f; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'A'. B r4 = false ? e : f; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'B'. var r5; r5 = (true ? e : f).e; r5 = (false ? e : f).f; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'f' isn't defined for the class 'E'. } diff --git a/tests/language_2/malformed/inheritance_test.dart b/tests/language_2/malformed/inheritance_test.dart index 55154d7b0de..8eed85875db 100644 --- a/tests/language_2/malformed/inheritance_test.dart +++ b/tests/language_2/malformed/inheritance_test.dart @@ -18,7 +18,7 @@ class C class C1 extends A // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } @@ -36,7 +36,7 @@ class C2 class C3 extends Object with A // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } @@ -52,7 +52,7 @@ class C4 class C5 implements A // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } @@ -63,7 +63,7 @@ class C6 // [analyzer] COMPILE_TIME_ERROR.EXTENDS_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS { } @@ -73,9 +73,9 @@ class C7 // [analyzer] COMPILE_TIME_ERROR.EXTENDS_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } @@ -88,7 +88,7 @@ class C8 // [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS { } @@ -100,9 +100,9 @@ class C9 // [analyzer] COMPILE_TIME_ERROR.MIXIN_OF_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } @@ -113,7 +113,7 @@ class C10 // [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS { } @@ -123,9 +123,9 @@ class C11 // [analyzer] COMPILE_TIME_ERROR.IMPLEMENTS_NON_CLASS // [cfe] Can't use type arguments with type variable 'A'. // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] Type 'Unresolved' not found. { } diff --git a/tests/language_2/malformed/malformed_test.dart b/tests/language_2/malformed/malformed_test.dart index d8254600c01..7f51c3dfcbe 100644 --- a/tests/language_2/malformed/malformed_test.dart +++ b/tests/language_2/malformed/malformed_test.dart @@ -29,25 +29,25 @@ checkIsUnresolved(var v) { checkIsListUnresolved(var v) { v is List; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'Unresolved' isn't a type. v is List>; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'Unresolved' isn't a type. v is List; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // ^ // [cfe] 'Unresolved' isn't a type. v is List>; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // ^ // [cfe] 'Unresolved' isn't a type. v is List; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. } @@ -75,25 +75,25 @@ checkAsUnresolved(var v) { checkAsListUnresolved(var v) { v as List; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'Unresolved' isn't a type. v as List>; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'Unresolved' isn't a type. v as List; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // ^ // [cfe] 'Unresolved' isn't a type. v as List>; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT + // [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // ^ // [cfe] 'Unresolved' isn't a type. v as List; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. } diff --git a/tests/language_2/map/literal13_test.dart b/tests/language_2/map/literal13_test.dart index ec5e0bef927..08f06e4cacb 100644 --- a/tests/language_2/map/literal13_test.dart +++ b/tests/language_2/map/literal13_test.dart @@ -7,7 +7,7 @@ main() { var map = new Map{ "a": 1, "b": 2, "c": 3 }; // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. // ^ // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN diff --git a/tests/language_2/mixin/illegal_static_access_test.dart b/tests/language_2/mixin/illegal_static_access_test.dart index 21e2348239a..8cd792de5a6 100644 --- a/tests/language_2/mixin/illegal_static_access_test.dart +++ b/tests/language_2/mixin/illegal_static_access_test.dart @@ -20,10 +20,10 @@ main() { Expect.throwsNoSuchMethodError(() => C.foo()); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'C.foo'. Expect.throwsNoSuchMethodError(() => C.bar()); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'C.bar'. } diff --git a/tests/language_2/mixin/illegal_super_use_test.dart b/tests/language_2/mixin/illegal_super_use_test.dart index 89c3a7648c9..ca4764551c1 100644 --- a/tests/language_2/mixin/illegal_super_use_test.dart +++ b/tests/language_2/mixin/illegal_super_use_test.dart @@ -11,22 +11,22 @@ class P0 { super.toString(); super.foo(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_METHOD // [cfe] Superclass has no method named 'foo'. super.bar = 100; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_SETTER // [cfe] Superclass has no setter named 'bar'. void inner() { super.toString(); super.foo(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_METHOD // [cfe] Superclass has no method named 'foo'. super.bar = 100; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_SETTER // [cfe] Superclass has no setter named 'bar'. } inner(); @@ -35,11 +35,11 @@ class P0 { super.toString(); super.foo(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_METHOD // [cfe] Superclass has no method named 'foo'. super.bar = 100; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SUPER_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SUPER_SETTER // [cfe] Superclass has no setter named 'bar'. })(); diff --git a/tests/language_2/mixin/type_parameters_errors_test.dart b/tests/language_2/mixin/type_parameters_errors_test.dart index 2988b2f8374..25e99b6d77a 100644 --- a/tests/language_2/mixin/type_parameters_errors_test.dart +++ b/tests/language_2/mixin/type_parameters_errors_test.dart @@ -11,11 +11,11 @@ class B extends S with M { } // ^ // [cfe] The type 'M' can't be mixed in. // ^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. class C extends S with M { } // ^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. class F = S with M; @@ -23,7 +23,7 @@ class G = S with M; // ^ // [cfe] The type 'M' can't be mixed in. // ^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. main() { @@ -32,11 +32,11 @@ main() { a = new A(); a = new A(); // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. a = new F(); a = new F(); // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS + // [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 1 type arguments. } diff --git a/tests/language_2/null/checked_null_test.dart b/tests/language_2/null/checked_null_test.dart index f6187cce232..f33227b4416 100644 --- a/tests/language_2/null/checked_null_test.dart +++ b/tests/language_2/null/checked_null_test.dart @@ -25,6 +25,6 @@ bar() { // crash. new A().a.foo(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'foo' isn't defined for the class 'Map'. } diff --git a/tests/language_2/null_aware/access_test.dart b/tests/language_2/null_aware/access_test.dart index 4965ccb8f1a..7a216c954d7 100644 --- a/tests/language_2/null_aware/access_test.dart +++ b/tests/language_2/null_aware/access_test.dart @@ -35,19 +35,19 @@ main() { { int i = new C(1)?.v; Expect.equals(1, i); } { String s = new C(null)?.v; Expect.equals(null, s); } // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int' can't be assigned to a variable of type 'String'. { C.staticInt = 1; int i = C?.staticInt; Expect.equals(1, i); } { h.C.staticInt = 1; int i = h.C?.staticInt; Expect.equals(1, i); } { C.staticInt = null; String s = C?.staticInt; Expect.equals(null, s); } // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int' can't be assigned to a variable of type 'String'. { h.C.staticInt = null; String s = h.C?.staticInt; Expect.equals(null, s); } // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int' can't be assigned to a variable of type 'String'. @@ -56,11 +56,11 @@ main() { // generated in the case of e1?.id. Expect.equals(null, nullC()?.bad); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'bad' isn't defined for the class 'C'. { B b = new C(1); Expect.equals(1, b?.v); } // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'v' isn't defined for the class 'B'. // '?.' cannot be used to access toplevel properties in libraries imported via @@ -73,10 +73,10 @@ main() { // Nor can it be used to access the hashCode getter on the class Type. Expect.throwsNoSuchMethodError(() => C?.hashCode); // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Getter not found: 'hashCode'. Expect.throwsNoSuchMethodError(() => h.C?.hashCode); // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Getter not found: 'hashCode'. } diff --git a/tests/language_2/null_aware/assignment_test.dart b/tests/language_2/null_aware/assignment_test.dart index 0b971676f46..7a198734494 100644 --- a/tests/language_2/null_aware/assignment_test.dart +++ b/tests/language_2/null_aware/assignment_test.dart @@ -57,19 +57,19 @@ main() { { D d = new D(new E()); G g = new G(); F f = (d?.v = g); Expect.identical(f, g); } { D d = new D(new E()); E e = new G(); F f = (d?.v = e); } // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. { D.staticE = new E(); G g = new G(); F f = (D?.staticE = g); Expect.identical(f, g); } { h.D.staticE = new h.E(); h.G g = new h.G(); h.F f = (h.D?.staticE = g); Expect.identical(f, g); } { D.staticE = new E(); E e = new G(); F f = (D?.staticE = e); } // ^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. { h.D.staticE = new h.E(); h.E e = new h.G(); h.F f = (h.D?.staticE = e); } // ^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. @@ -77,11 +77,11 @@ main() { // also generated in the case of e1?.v = e2. Expect.equals(null, nullC()?.bad = bad()); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'bad' isn't defined for the class 'C'. { B b = new C(1); Expect.equals(2, b?.v = 2); } // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'v' isn't defined for the class 'B'. // e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1). @@ -101,14 +101,14 @@ main() { // also generated in the case of e1?.v op= e2. nullC()?.bad = bad(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'bad' isn't defined for the class 'C'. { B b = new C(1); b?.v += 2; } // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'v' isn't defined for the class 'B'. // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] The setter 'v' isn't defined for the class 'B'. { D d = new D(new E()); F f = (d?.v += nullC()); } // ^^^^^^^ @@ -116,7 +116,7 @@ main() { // [cfe] A value of type 'C' can't be assigned to a variable of type 'int'. { D d = new D(new E()); H h = (d?.v += 1); } // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H'. { D.staticE = new E(); F f = (D?.staticE += nullC()); } @@ -129,12 +129,12 @@ main() { // [cfe] A value of type 'C' can't be assigned to a variable of type 'int'. { D.staticE = new E(); H h = (D?.staticE += 1); } // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H'. { h.D.staticE = new h.E(); h.H hh = (h.D?.staticE += 1); } // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H'. diff --git a/tests/language_2/null_aware/increment_decrement_test.dart b/tests/language_2/null_aware/increment_decrement_test.dart index 2341f98352c..4e7796ef95c 100644 --- a/tests/language_2/null_aware/increment_decrement_test.dart +++ b/tests/language_2/null_aware/increment_decrement_test.dart @@ -52,18 +52,18 @@ main() { { E e1 = new E(); D d = new D(e1); E e2 = d?.v++; Expect.identical(e1, e2); } { G g = new G(); D d = new D(g); F f = d?.v++; Expect.identical(f, g); } // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. { E e1 = new E(); D.staticE = e1; E e2 = D?.staticE++; Expect.identical(e1, e2); } { h.E e1 = new h.E(); h.D.staticE = e1; h.E e2 = h.D?.staticE++; Expect.identical(e1, e2); } { G g = new G(); D.staticE = g; F f = D?.staticE++; Expect.identical(f, g); } // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. { h.G g = new h.G(); h.D.staticE = g; h.F f = h.D?.staticE++; Expect.identical(f, g); } // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. @@ -79,18 +79,18 @@ main() { { E e1 = new E(); D d = new D(e1); E e2 = d?.v--; Expect.identical(e1, e2); } { G g = new G(); D d = new D(g); F f = d?.v--; Expect.identical(f, g); } // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. { E e1 = new E(); D.staticE = e1; E e2 = D?.staticE--; Expect.identical(e1, e2); } { h.E e1 = new h.E(); h.D.staticE = e1; h.E e2 = h.D?.staticE--; Expect.identical(e1, e2); } { G g = new G(); D.staticE = g; F f = D?.staticE--; Expect.identical(f, g); } // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. { h.G g = new h.G(); h.D.staticE = g; h.F f = h.D?.staticE--; Expect.identical(f, g); } // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'E' can't be assigned to a variable of type 'F'. @@ -106,19 +106,19 @@ main() { { D d = new D(new E()); F f = ++d?.v; Expect.identical(d.v, f); } { D d = new D(new E()); H h = ++d?.v; Expect.identical(d.v, h); } // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H'. { D.staticE = new E(); F f = ++D?.staticE; Expect.identical(D.staticE, f); } { h.D.staticE = new h.E(); h.F f = ++h.D?.staticE; Expect.identical(h.D.staticE, f); } { D.staticE = new E(); H h = ++D?.staticE; Expect.identical(D.staticE, h); } // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H'. { h.D.staticE = new h.E(); h.H hh = ++h.D?.staticE; Expect.identical(h.D.staticE, hh); } // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H'. @@ -134,19 +134,19 @@ main() { { D d = new D(new E()); F f = --d?.v; Expect.identical(d.v, f); } { D d = new D(new E()); H h = --d?.v; Expect.identical(d.v, h); } // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H'. { D.staticE = new E(); F f = --D?.staticE; Expect.identical(D.staticE, f); } { h.D.staticE = new h.E(); h.F f = --h.D?.staticE; Expect.identical(h.D.staticE, f); } { D.staticE = new E(); H h = --D?.staticE; Expect.identical(D.staticE, h); } // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H'. { h.D.staticE = new h.E(); h.H hh = --h.D?.staticE; Expect.identical(h.D.staticE, hh); } // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'G' can't be assigned to a variable of type 'H'. } diff --git a/tests/language_2/null_aware/invocation_test.dart b/tests/language_2/null_aware/invocation_test.dart index 03c3ddb38b2..e8823535938 100644 --- a/tests/language_2/null_aware/invocation_test.dart +++ b/tests/language_2/null_aware/invocation_test.dart @@ -41,23 +41,23 @@ main() { { int i = new C()?.g(() => 1); Expect.equals(1, i); } { String s = nullC()?.g(bad()); Expect.equals(null, s); } // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'int' can't be assigned to a variable of type 'String'. { String s = new C()?.g(() => null); Expect.equals(null, s); } // ^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int' can't be assigned to a variable of type 'String'. { int i = C?.staticG(() => 1); Expect.equals(1, i); } { int i = h.C?.staticG(() => 1); Expect.equals(1, i); } { String s = C?.staticG(() => null); Expect.equals(null, s); } // ^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int' can't be assigned to a variable of type 'String'. { String s = h.C?.staticG(() => null); Expect.equals(null, s); } // ^^^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'int' can't be assigned to a variable of type 'String'. @@ -66,7 +66,7 @@ main() { // generated in the case of o?.m(...). { B b = new C(); Expect.equals(1, b?.f(() => 1)); } // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'f' isn't defined for the class 'B'. { int i = 1; Expect.equals(null, nullC()?.f(i)); } // ^ @@ -83,10 +83,10 @@ main() { // Nor can it be used to access the toString method on the class Type. Expect.throwsNoSuchMethodError(() => C?.toString()); // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'C.toString'. Expect.throwsNoSuchMethodError(() => h.C?.toString()); // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'C.toString'. } diff --git a/tests/language_2/number/identifier_test.dart b/tests/language_2/number/identifier_test.dart index 7b575c5c9e0..d66bf6b31a0 100644 --- a/tests/language_2/number/identifier_test.dart +++ b/tests/language_2/number/identifier_test.dart @@ -68,7 +68,7 @@ main() { Expect.equals(1e+2, 1e+2 as double); Expect.throwsNoSuchMethodError(() => 1.e+2); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'e' isn't defined for the class 'int'. 1d; //^ @@ -86,11 +86,11 @@ main() { // [cfe] Getter not found: 'D'. Expect.throwsNoSuchMethodError(() => 1.d+2); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'int'. Expect.throwsNoSuchMethodError(() => 1.D+2); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'D' isn't defined for the class 'int'. 1.1d; //^^^ diff --git a/tests/language_2/override/method_with_field_test.dart b/tests/language_2/override/method_with_field_test.dart index edd17fdfa1a..7d31ba2f4aa 100644 --- a/tests/language_2/override/method_with_field_test.dart +++ b/tests/language_2/override/method_with_field_test.dart @@ -31,7 +31,7 @@ main() { Expect.equals(42, s.superInstanceMethod()); Expect.equals(42, sup.superInstanceMethod()); // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'superInstanceMethod' isn't defined for the class 'Super'. Expect.equals(42, sub.superInstanceMethod()); } diff --git a/tests/language_2/prefix/shadow_test.dart b/tests/language_2/prefix/shadow_test.dart index 1680b1ec7d6..1af4c58c56b 100644 --- a/tests/language_2/prefix/shadow_test.dart +++ b/tests/language_2/prefix/shadow_test.dart @@ -27,7 +27,7 @@ main() { var result = 0; result = lib10.Library10.static_fld; // ^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'Library10' isn't defined for the class 'int'. Expect.equals(4, result); } diff --git a/tests/language_2/prefix/transitive_import_test.dart b/tests/language_2/prefix/transitive_import_test.dart index 582b3e23f6b..ef53584d86d 100644 --- a/tests/language_2/prefix/transitive_import_test.dart +++ b/tests/language_2/prefix/transitive_import_test.dart @@ -16,6 +16,6 @@ main() { // Variable should not be visible. lib12.top_level11; // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_PREFIXED_NAME + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_PREFIXED_NAME // [cfe] Getter not found: 'top_level11'. } diff --git a/tests/language_2/private/access_test.dart b/tests/language_2/private/access_test.dart index cbfef181ab8..6e10558cd3e 100644 --- a/tests/language_2/private/access_test.dart +++ b/tests/language_2/private/access_test.dart @@ -10,13 +10,13 @@ import 'access_lib.dart' as private; main() { _function(); //^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION // [cfe] Method not found: '_function'. private._function(); //^ // [cfe] Method not found: '_function'. // ^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION new _Class(); // ^^^^^^ // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE @@ -25,7 +25,7 @@ main() { //^ // [cfe] Method not found: '_Class'. // ^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION new Class._constructor(); // ^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.NEW_WITH_UNDEFINED_CONSTRUCTOR diff --git a/tests/language_2/private/member3_test.dart b/tests/language_2/private/member3_test.dart index eba3211c42e..557a9e6ca2d 100644 --- a/tests/language_2/private/member3_test.dart +++ b/tests/language_2/private/member3_test.dart @@ -10,7 +10,7 @@ class Test extends B { test() { _fun(); // ^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method '_fun' isn't defined for the class 'Test'. } } diff --git a/tests/language_2/regress/regress11724_test.dart b/tests/language_2/regress/regress11724_test.dart index ddf3925df9a..a408da1dfd2 100644 --- a/tests/language_2/regress/regress11724_test.dart +++ b/tests/language_2/regress/regress11724_test.dart @@ -7,6 +7,6 @@ import "package:expect/expect.dart"; void main() { method([]); //^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION // [cfe] Method not found: 'method'. } diff --git a/tests/language_2/regress/regress1363_test.dart b/tests/language_2/regress/regress1363_test.dart index cd7df8ffa93..27f02c25fcf 100644 --- a/tests/language_2/regress/regress1363_test.dart +++ b/tests/language_2/regress/regress1363_test.dart @@ -24,7 +24,7 @@ class C { C contents = myCup.getContents(); // expect no warning or error contents = libCup.getContents(); // ^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'C/*1*/' can't be assigned to a variable of type 'C/*2*/'. } diff --git a/tests/language_2/regress/regress18628_1_test.dart b/tests/language_2/regress/regress18628_1_test.dart index 3f2bef343f8..214f9aab6c3 100644 --- a/tests/language_2/regress/regress18628_1_test.dart +++ b/tests/language_2/regress/regress18628_1_test.dart @@ -13,7 +13,7 @@ class C { // line just doesn't make sense without this line. T t = int; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Type' can't be assigned to a variable of type 'T'. } diff --git a/tests/language_2/regress/regress21912_test.dart b/tests/language_2/regress/regress21912_test.dart index 46e6e5811d4..eaacaad81e3 100644 --- a/tests/language_2/regress/regress21912_test.dart +++ b/tests/language_2/regress/regress21912_test.dart @@ -19,11 +19,11 @@ void main() { Function2, Function2> left; left = t1; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A Function(B) Function(B Function(A))' can't be assigned to a variable of type 'double Function(int) Function(double Function(int))'. left = t2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'A Function(B) Function(B Function(A))' can't be assigned to a variable of type 'double Function(int) Function(double Function(int))'. } } diff --git a/tests/language_2/regress/regress22976_test.dart b/tests/language_2/regress/regress22976_test.dart index 63180f8ce21..de83e9b2170 100644 --- a/tests/language_2/regress/regress22976_test.dart +++ b/tests/language_2/regress/regress22976_test.dart @@ -20,7 +20,7 @@ main() { A a0 = c1; A a1 = c2; // ^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'C' can't be assigned to a variable of type 'A'. } diff --git a/tests/language_2/regress/regress34489_test.dart b/tests/language_2/regress/regress34489_test.dart index a29cab83db7..7fba3cb4aa9 100644 --- a/tests/language_2/regress/regress34489_test.dart +++ b/tests/language_2/regress/regress34489_test.dart @@ -9,6 +9,6 @@ class C { main() { new C().field = 'bad'; // ^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'String' can't be assigned to a variable of type 'Type'. } diff --git a/tests/language_2/regress/regress34495_test.dart b/tests/language_2/regress/regress34495_test.dart index 41e58bf69ff..2e69b38da87 100644 --- a/tests/language_2/regress/regress34495_test.dart +++ b/tests/language_2/regress/regress34495_test.dart @@ -7,7 +7,7 @@ final foo = A.foo(); // [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE // [cfe] Method not found: 'A'. // ^ -// [analyzer] STATIC_TYPE_WARNING.NON_TYPE_AS_TYPE_ARGUMENT +// [analyzer] COMPILE_TIME_ERROR.NON_TYPE_AS_TYPE_ARGUMENT // [cfe] 'B' isn't a type. main() {} diff --git a/tests/language_2/regress/regress35043_test.dart b/tests/language_2/regress/regress35043_test.dart index 884f707196b..d8c1b7578d8 100644 --- a/tests/language_2/regress/regress35043_test.dart +++ b/tests/language_2/regress/regress35043_test.dart @@ -4,7 +4,7 @@ final foo = Map(); // ^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 2 type arguments. main() {} diff --git a/tests/language_2/rewrite/implicit_this_test.dart b/tests/language_2/rewrite/implicit_this_test.dart index 078dcd20a7e..28adbcf3843 100644 --- a/tests/language_2/rewrite/implicit_this_test.dart +++ b/tests/language_2/rewrite/implicit_this_test.dart @@ -20,7 +20,7 @@ class Foo { shadow_y_parameter(y) { return x + this.y + y; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. } @@ -28,7 +28,7 @@ class Foo { var y = z; return x + this.y + y; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. } @@ -37,7 +37,7 @@ class Foo { foo() { return x + this.y + y; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. } return foo(); @@ -47,7 +47,7 @@ class Foo { foo(y) { return x + this.y + y; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. } return foo(z); @@ -58,7 +58,7 @@ class Foo { var y = z; return x + this.y + y; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. } @@ -117,10 +117,10 @@ class Foo { shadow_x_toplevel() { return x + this.y + toplevel + this.toplevel; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'y' isn't defined for the class 'Foo'. // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'toplevel' isn't defined for the class 'Foo'. } } diff --git a/tests/language_2/setter/no_getter_call_test.dart b/tests/language_2/setter/no_getter_call_test.dart index 77b06dc9520..a49d8e4c5bb 100644 --- a/tests/language_2/setter/no_getter_call_test.dart +++ b/tests/language_2/setter/no_getter_call_test.dart @@ -23,7 +23,7 @@ main() { x = topLevel(3); // ^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_FUNCTION + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_FUNCTION // [cfe] Getter not found: 'topLevel'. Expect.equals(6, x); } diff --git a/tests/language_2/setter/no_getter_test.dart b/tests/language_2/setter/no_getter_test.dart index f2ea3e36a03..53c8b58ba73 100644 --- a/tests/language_2/setter/no_getter_test.dart +++ b/tests/language_2/setter/no_getter_test.dart @@ -17,6 +17,6 @@ main() { Example ex = new Example(); print(ex.foo++); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'foo' isn't defined for the class 'Example'. } diff --git a/tests/language_2/static/field1_test.dart b/tests/language_2/static/field1_test.dart index e4e147270a1..7c3c338b8ca 100644 --- a/tests/language_2/static/field1_test.dart +++ b/tests/language_2/static/field1_test.dart @@ -14,7 +14,7 @@ class StaticField1Test { var foo = new Foo(); var x = foo.x; // ^ - // [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER + // [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // [cfe] The getter 'x' isn't defined for the class 'Foo'. } } diff --git a/tests/language_2/static/field1a_test.dart b/tests/language_2/static/field1a_test.dart index 9d7f2f258ee..27a336d8181 100644 --- a/tests/language_2/static/field1a_test.dart +++ b/tests/language_2/static/field1a_test.dart @@ -14,7 +14,7 @@ class StaticField1aTest { var foo = new Foo(); var m = foo.m; // ^ - // [analyzer] STATIC_TYPE_WARNING.INSTANCE_ACCESS_TO_STATIC_MEMBER + // [analyzer] COMPILE_TIME_ERROR.INSTANCE_ACCESS_TO_STATIC_MEMBER // [cfe] The getter 'm' isn't defined for the class 'Foo'. } } diff --git a/tests/language_2/static/field3_test.dart b/tests/language_2/static/field3_test.dart index 0498f48f008..f794e68c490 100644 --- a/tests/language_2/static/field3_test.dart +++ b/tests/language_2/static/field3_test.dart @@ -21,7 +21,7 @@ main() { // [cfe] Getter not found: 'm'. Foo.m = 1; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_SETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER // [cfe] Setter not found: 'm'. Foo.x = 1; // ^ diff --git a/tests/language_2/string/interpolation_test.dart b/tests/language_2/string/interpolation_test.dart index 8fd6facdbd0..debcbf3c6c2 100644 --- a/tests/language_2/string/interpolation_test.dart +++ b/tests/language_2/string/interpolation_test.dart @@ -60,7 +60,7 @@ class StringInterpolationTest { if (alwaysFalse) { "${i.toHorse()}"; // ^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'toHorse' isn't defined for the class 'int'. } diff --git a/tests/language_2/string/no_operator_test.dart b/tests/language_2/string/no_operator_test.dart index d5d013c7727..a7eabf71677 100644 --- a/tests/language_2/string/no_operator_test.dart +++ b/tests/language_2/string/no_operator_test.dart @@ -9,23 +9,23 @@ main() { var y = "y"; Expect.throws(() => x < y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '<' isn't defined for the class 'String'. Expect.throws(() => x <= y); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '<=' isn't defined for the class 'String'. Expect.throws(() => x > y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '>' isn't defined for the class 'String'. Expect.throws(() => x >= y); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '>=' isn't defined for the class 'String'. Expect.throws(() => x - y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '-' isn't defined for the class 'String'. Expect.throws(() => x * y); // ^ @@ -33,42 +33,42 @@ main() { // [cfe] A value of type 'String' can't be assigned to a variable of type 'int'. Expect.throws(() => x / y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '/' isn't defined for the class 'String'. Expect.throws(() => x ~/ y); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '~/' isn't defined for the class 'String'. Expect.throws(() => x % y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '%' isn't defined for the class 'String'. Expect.throws(() => x >> y); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '>>' isn't defined for the class 'String'. Expect.throws(() => x << y); // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '<<' isn't defined for the class 'String'. Expect.throws(() => x & y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '&' isn't defined for the class 'String'. Expect.throws(() => x | y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '|' isn't defined for the class 'String'. Expect.throws(() => x ^ y); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '^' isn't defined for the class 'String'. Expect.throws(() => -x); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator 'unary-' isn't defined for the class 'String'. Expect.throws(() => ~x); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '~' isn't defined for the class 'String'. } diff --git a/tests/language_2/string/string_test.dart b/tests/language_2/string/string_test.dart index da6d40aa306..68cca7583af 100644 --- a/tests/language_2/string/string_test.dart +++ b/tests/language_2/string/string_test.dart @@ -33,7 +33,7 @@ class StringTest { String a = "Hello"; a[1] = 12; // ^^^ -// [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR +// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'String'. } diff --git a/tests/language_2/super/assign_test.dart b/tests/language_2/super/assign_test.dart index d3c1b904a03..3e77ef5fda4 100644 --- a/tests/language_2/super/assign_test.dart +++ b/tests/language_2/super/assign_test.dart @@ -17,6 +17,6 @@ main() { a.x = 37; a.setX(42); //^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] The method 'setX' isn't defined for the class 'A'. } diff --git a/tests/language_2/super/conditional_operator_test.dart b/tests/language_2/super/conditional_operator_test.dart index cd2d49881f1..5c41ab4bb49 100644 --- a/tests/language_2/super/conditional_operator_test.dart +++ b/tests/language_2/super/conditional_operator_test.dart @@ -52,7 +52,7 @@ class C extends B { // [cfe] The operator '?.' cannot be used with 'super' because 'super' cannot be null. !super?.field; // ^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.NON_BOOL_NEGATION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.NON_BOOL_NEGATION_EXPRESSION // ^^ // [analyzer] SYNTACTIC_ERROR.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER // [cfe] The operator '?.' cannot be used with 'super' because 'super' cannot be null. diff --git a/tests/language_2/symbol/literal_test.dart b/tests/language_2/symbol/literal_test.dart index 268b610c05f..976158f7221 100644 --- a/tests/language_2/symbol/literal_test.dart +++ b/tests/language_2/symbol/literal_test.dart @@ -46,7 +46,7 @@ main() { // Tries to call the symbol literal #a.toString Expect.throwsNoSuchMethodError(() => #a.toString()); // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'Symbol'. } diff --git a/tests/language_2/sync_star/generator1_test.dart b/tests/language_2/sync_star/generator1_test.dart index 79b294d4c04..ef6bd9bf098 100644 --- a/tests/language_2/sync_star/generator1_test.dart +++ b/tests/language_2/sync_star/generator1_test.dart @@ -48,7 +48,7 @@ dreiVier() sync* { // Throws type error: yielded object is not an iterable. yield* 3; // ^ - // [analyzer] STATIC_TYPE_WARNING.YIELD_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.YIELD_OF_INVALID_TYPE // [cfe] A value of type 'int' can't be assigned to a variable of type 'Iterable'. } diff --git a/tests/language_2/this/conditional_operator_test.dart b/tests/language_2/this/conditional_operator_test.dart index 75f711cc226..9ccddb2d10e 100644 --- a/tests/language_2/this/conditional_operator_test.dart +++ b/tests/language_2/this/conditional_operator_test.dart @@ -21,7 +21,7 @@ class B { //^^^^^^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD // [error line 15, column 11, length 0] - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Expected '.' before this. // ^^ // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN diff --git a/tests/language_2/type_object/first_class_types_literals_test.dart b/tests/language_2/type_object/first_class_types_literals_test.dart index e8fdca56bc7..663e5162ea3 100644 --- a/tests/language_2/type_object/first_class_types_literals_test.dart +++ b/tests/language_2/type_object/first_class_types_literals_test.dart @@ -54,46 +54,46 @@ main() { // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_TYPE // [cfe] Can't assign to a type literal. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT Expect.throwsNoSuchMethodError(() => C++); // ^ // [analyzer] COMPILE_TIME_ERROR.ASSIGNMENT_TO_TYPE // [cfe] Can't assign to a type literal. // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR Expect.throwsNoSuchMethodError(() => C + 1); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '+' isn't defined for the class 'Type'. Expect.throwsNoSuchMethodError(() => C[2]); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'Type'. Expect.throwsNoSuchMethodError(() => C[2] = 'hest'); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'Type'. Expect.throwsNoSuchMethodError(() => dynamic = 1); // ^ // [cfe] Can't assign to a type literal. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT Expect.throwsNoSuchMethodError(() => dynamic++); // ^ // [cfe] Can't assign to a type literal. // ^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR Expect.throwsNoSuchMethodError(() => dynamic + 1); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '+' isn't defined for the class 'Type'. Expect.throwsNoSuchMethodError(() => dynamic[2]); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'Type'. Expect.throwsNoSuchMethodError(() => dynamic[2] = 'hest'); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]=' isn't defined for the class 'Type'. Expect.equals((dynamic).toString(), 'dynamic'); diff --git a/tests/language_2/type_promotion/assign_test.dart b/tests/language_2/type_promotion/assign_test.dart index 38f8f558f68..35d99d8494c 100644 --- a/tests/language_2/type_promotion/assign_test.dart +++ b/tests/language_2/type_promotion/assign_test.dart @@ -33,7 +33,7 @@ void main() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. a = null; } @@ -42,14 +42,14 @@ void main() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } if (a is B) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. { a = null; @@ -57,7 +57,7 @@ void main() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } } diff --git a/tests/language_2/type_promotion/closure_test.dart b/tests/language_2/type_promotion/closure_test.dart index 9fb7568fa86..2e6fec9f0fe 100644 --- a/tests/language_2/type_promotion/closure_test.dart +++ b/tests/language_2/type_promotion/closure_test.dart @@ -55,7 +55,7 @@ void test1() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } void foo() { @@ -73,7 +73,7 @@ void test2() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } } @@ -88,7 +88,7 @@ void test3() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. void foo() { a = new D(); @@ -97,7 +97,7 @@ void test3() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } } @@ -112,7 +112,7 @@ void test3a() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. void foo() { a = new D(); @@ -121,7 +121,7 @@ void test3a() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } } @@ -140,7 +140,7 @@ void test5() { if (a is B) { func(() => a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.a); } @@ -154,7 +154,7 @@ void test6() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } a = null; @@ -167,7 +167,7 @@ void test6a() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } a = null; @@ -187,7 +187,7 @@ void test8() { if (a is B && func(() => a.b) // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. ) { print(a.a); @@ -199,7 +199,7 @@ void test9() { A a = new E(); var b = a is B ? func(() => a.b) : false; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. a = null; } @@ -210,7 +210,7 @@ void test10() { func(() => a[0]); print(a[0].b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } a = null; @@ -222,7 +222,7 @@ void test11() { func(() => a[0] = null); print(a[0].b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } a = null; @@ -235,7 +235,7 @@ void test12() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } a = null; diff --git a/tests/language_2/type_promotion/functions_test.dart b/tests/language_2/type_promotion/functions_test.dart index 590f1ccc4c6..30de4c10a1b 100644 --- a/tests/language_2/type_promotion/functions_test.dart +++ b/tests/language_2/type_promotion/functions_test.dart @@ -87,7 +87,7 @@ testFuncDynToDyn() { b = funcDynToDyn(new B()); c = funcDynToDyn(new C()); // ^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'C'. } @@ -124,7 +124,7 @@ testFuncDynToVoid() { b = funcDynToVoid(new B()); c = funcDynToVoid(new C()); // ^^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'C'. } @@ -136,7 +136,7 @@ testFuncDynToA() { b = funcDynToA(new B()); c = funcDynToA(new C()); // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'C'. @@ -146,7 +146,7 @@ testFuncDynToA() { b = funcDynToA(new B()); c = funcDynToA(new C()); // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'C'. } @@ -157,7 +157,7 @@ testFuncDynToA() { b = funcDynToA(new B()); c = funcDynToA(new C()); // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'C'. } diff --git a/tests/language_2/type_promotion/local_test.dart b/tests/language_2/type_promotion/local_test.dart index c0fe87d649a..85b0386e604 100644 --- a/tests/language_2/type_promotion/local_test.dart +++ b/tests/language_2/type_promotion/local_test.dart @@ -32,15 +32,15 @@ void main() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. if (a is B) { @@ -48,11 +48,11 @@ void main() { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. if (a is C) { @@ -61,7 +61,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } @@ -69,11 +69,11 @@ void main() { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. } if (a is C) { @@ -82,7 +82,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. if (a is B) { @@ -91,7 +91,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is D) { @@ -100,7 +100,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } @@ -109,33 +109,33 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. if (a is D) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. print(a.d); } @@ -143,15 +143,15 @@ void main() { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. var o1 = a is B @@ -159,24 +159,24 @@ void main() { '${a.b}' '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -186,20 +186,20 @@ void main() { '${a.c}' '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -207,25 +207,25 @@ void main() { ? '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. '${a.d}' : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -234,11 +234,11 @@ void main() { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. } if (a is B && a is C) { @@ -247,7 +247,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is C && a is B) { @@ -256,7 +256,7 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is C && a is D) { @@ -265,18 +265,18 @@ void main() { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is D && a is C) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. print(a.d); } diff --git a/tests/language_2/type_promotion/logical_and_test.dart b/tests/language_2/type_promotion/logical_and_test.dart index 7dc5b2bc442..79945bab65c 100644 --- a/tests/language_2/type_promotion/logical_and_test.dart +++ b/tests/language_2/type_promotion/logical_and_test.dart @@ -33,19 +33,19 @@ void main() { if (a is D && ((a = new D()) != null)) { b = a.d; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER } if (a is D && (b = a.d)) { b = a.d; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. a = null; } if ((((a) is D) && (b = (a).d))) { b = a.d; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. a = null; } diff --git a/tests/language_2/type_promotion/more_specific_test.dart b/tests/language_2/type_promotion/more_specific_test.dart index ec19e52966f..2e7d840f7af 100644 --- a/tests/language_2/type_promotion/more_specific_test.dart +++ b/tests/language_2/type_promotion/more_specific_test.dart @@ -48,7 +48,7 @@ void testInterface() { // No promotion C !<< A. x = a.c; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. } B b = new B(); @@ -60,7 +60,7 @@ void testInterface() { // Promotion A << dynamic. y = x.b; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. } } @@ -78,12 +78,12 @@ testGeneric() { // Promotion: E << D. int a = d1.d; // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'int'. String b = d1.d; // ^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'A' can't be assigned to a variable of type 'String'. x = d1.e; @@ -94,7 +94,7 @@ testGeneric() { // No promotion: E !<< D x = d2.e; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'e' isn't defined for the class 'D'. } diff --git a/tests/language_2/type_promotion/multiple_test.dart b/tests/language_2/type_promotion/multiple_test.dart index 8410597bab0..21a2f7dc7e5 100644 --- a/tests/language_2/type_promotion/multiple_test.dart +++ b/tests/language_2/type_promotion/multiple_test.dart @@ -36,29 +36,29 @@ void test(A a1) { print(a1.a); print(a1.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a1.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a1.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. print(a2.a); print(a2.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a2.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a2.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. if (a1 is B && a2 is C) { @@ -66,11 +66,11 @@ void test(A a1) { print(a1.b); print(a1.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a1.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. print(a2.a); @@ -78,7 +78,7 @@ void test(A a1) { print(a2.c); print(a2.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. if (a1 is C && a2 is D) { @@ -87,7 +87,7 @@ void test(A a1) { print(a1.c); print(a1.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. print(a2.a); @@ -95,7 +95,7 @@ void test(A a1) { print(a2.c); print(a2.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } } @@ -105,44 +105,44 @@ void test(A a1) { '${a1.b}' '${a1.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. '${a1.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. '${a2.a}' '${a2.b}' '${a2.c}' '${a2.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. : '${a1.a}' '${a1.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a1.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a1.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. '${a2.a}' '${a2.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a2.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a2.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -152,7 +152,7 @@ void test(A a1) { print(a1.c); print(a1.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. print(a2.a); @@ -160,7 +160,7 @@ void test(A a1) { print(a2.c); print(a2.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } } diff --git a/tests/language_2/type_promotion/parameter_test.dart b/tests/language_2/type_promotion/parameter_test.dart index b93d76417ff..7ce711971e8 100644 --- a/tests/language_2/type_promotion/parameter_test.dart +++ b/tests/language_2/type_promotion/parameter_test.dart @@ -35,15 +35,15 @@ void test(A a) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. if (a is B) { @@ -51,11 +51,11 @@ void test(A a) { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. if (a is C) { @@ -64,7 +64,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } @@ -72,11 +72,11 @@ void test(A a) { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. } if (a is C) { @@ -85,7 +85,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. if (a is B) { @@ -94,7 +94,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is D) { @@ -103,7 +103,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } @@ -112,33 +112,33 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. if (a is D) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. print(a.d); } @@ -146,15 +146,15 @@ void test(A a) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. var o1 = a is B @@ -162,24 +162,24 @@ void test(A a) { '${a.b}' '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -189,20 +189,20 @@ void test(A a) { '${a.c}' '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -210,25 +210,25 @@ void test(A a) { ? '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. '${a.d}' : '${a.a}' '${a.b}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. '${a.c}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. '${a.d}' // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. ; @@ -237,11 +237,11 @@ void test(A a) { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. } if (a is B && a is C) { @@ -250,7 +250,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is C && a is B) { @@ -259,7 +259,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is C && a is D) { @@ -268,18 +268,18 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if (a is D && a is C) { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. print(a.d); } @@ -287,37 +287,37 @@ void test(A a) { a.a == "" && a.b == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. && a.c == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. && a.d == "") { print(a.a); print(a.b); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'D'. print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'D'. print(a.d); } if (a.a == "" && a.b == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'b' isn't defined for the class 'A'. && a.c == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'A'. && a.d == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'A'. && a is B && @@ -325,11 +325,11 @@ void test(A a) { a.b == "" && a.c == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. && a.d == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. && a is C && @@ -338,7 +338,7 @@ void test(A a) { a.c == "" && a.d == "" // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. ) { print(a.a); @@ -346,7 +346,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } if ((a is B)) { @@ -354,11 +354,11 @@ void test(A a) { print(a.b); print(a.c); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'c' isn't defined for the class 'B'. print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'B'. } if ((a is B && (a) is C) && a is B) { @@ -367,7 +367,7 @@ void test(A a) { print(a.c); print(a.d); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'd' isn't defined for the class 'C'. } } diff --git a/tests/language_2/type_variable/bound_access_test.dart b/tests/language_2/type_variable/bound_access_test.dart index 77f85945ed5..39d52ea229e 100644 --- a/tests/language_2/type_variable/bound_access_test.dart +++ b/tests/language_2/type_variable/bound_access_test.dart @@ -21,7 +21,7 @@ class NumClass { num method2() => field1 + field2.length; // ^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'length' isn't defined for the class 'num'. } diff --git a/tests/language_2/type_variable/conflict2_test.dart b/tests/language_2/type_variable/conflict2_test.dart index 8b8439d1225..f43e6091186 100644 --- a/tests/language_2/type_variable/conflict2_test.dart +++ b/tests/language_2/type_variable/conflict2_test.dart @@ -14,13 +14,13 @@ class C { // This is equivalent to (T).call(). See issue 19725 foo() => T(); // ^ - // [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION + // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION // [cfe] Method not found: 'T'. // T is in scope, even in static context. Compile-time error to call this.T(). static bar() => T(); // ^ - // [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION + // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION // [cfe] Method not found: 'T'. // ^ // [analyzer] COMPILE_TIME_ERROR.TYPE_PARAMETER_REFERENCED_BY_STATIC @@ -28,26 +28,26 @@ class C { // X is not in scope. NoSuchMethodError. static baz() => X(); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'X'. // Class 'C' has no static method 'T': NoSuchMethodError. static qux() => C.T(); // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_METHOD + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD // [cfe] Method not found: 'C.T'. // Class '_Type' has no instance method 'call': NoSuchMethodError. quux() => (T)(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [cfe] The method 'call' isn't defined for the class 'Type'. // Runtime type T not accessible from static context. Compile-time error. static corge() => (T)(); // ^^^ - // [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION + // [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION // ^ // [analyzer] COMPILE_TIME_ERROR.TYPE_PARAMETER_REFERENCED_BY_STATIC // [cfe] Type variables can't be used in static members. @@ -57,7 +57,7 @@ class C { // Class '_Type' has no [] operator: NoSuchMethodError. grault() => T[0]; // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'Type'. // Runtime type T not accessible from static context. Compile-time error. @@ -66,13 +66,13 @@ class C { // [analyzer] COMPILE_TIME_ERROR.TYPE_PARAMETER_REFERENCED_BY_STATIC // [cfe] Type variables can't be used in static members. // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '[]' isn't defined for the class 'Type'. // Class '_Type' has no member m: NoSuchMethodError. waldo() => T.m; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm' isn't defined for the class 'Type'. // Runtime type T not accessible from static context. Compile-time error. @@ -81,7 +81,7 @@ class C { // [analyzer] COMPILE_TIME_ERROR.TYPE_PARAMETER_REFERENCED_BY_STATIC // [cfe] Type variables can't be used in static members. // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] The getter 'm' isn't defined for the class 'Type'. } diff --git a/tests/language_2/type_variable/scope_test.dart b/tests/language_2/type_variable/scope_test.dart index 1b5cbb79c94..febaa5d745d 100644 --- a/tests/language_2/type_variable/scope_test.dart +++ b/tests/language_2/type_variable/scope_test.dart @@ -24,10 +24,10 @@ class Foo implements I { // [analyzer] COMPILE_TIME_ERROR.TYPE_PARAMETER_REFERENCED_BY_STATIC // [cfe] Type variables can't be used in static members. // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT return new Foo(); // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE } // T is in scope for a factory method. @@ -52,7 +52,7 @@ class Foo implements I { // [cfe] Can only use type variables in instance methods. return new Foo(); // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.RETURN_OF_INVALID_TYPE + // [analyzer] COMPILE_TIME_ERROR.RETURN_OF_INVALID_TYPE } static void set f( @@ -76,7 +76,7 @@ main() { new I(new Foo()); Foo.f1 = new Foo(); // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // ^ // [cfe] A value of type 'Foo' can't be assigned to a variable of type 'Foo'. var x = Foo.f; diff --git a/tests/language_2/unsorted/callable_test.dart b/tests/language_2/unsorted/callable_test.dart index 75ff4c2cebb..16dde1344b6 100644 --- a/tests/language_2/unsorted/callable_test.dart +++ b/tests/language_2/unsorted/callable_test.dart @@ -42,12 +42,12 @@ main() { //^ // [cfe] A value of type 'dynamic Function()' can't be assigned to a variable of type 'dynamic Function(int)'. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT G g0 = y; //^ // [cfe] A value of type 'dynamic Function(int)' can't be assigned to a variable of type 'dynamic Function(String)'. // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT Expect.equals(f(), 42); Expect.equals(g(100), 187); diff --git a/tests/language_2/unsorted/invalid_type_argument_count_test.dart b/tests/language_2/unsorted/invalid_type_argument_count_test.dart index 3a93da26446..cf9619d4790 100644 --- a/tests/language_2/unsorted/invalid_type_argument_count_test.dart +++ b/tests/language_2/unsorted/invalid_type_argument_count_test.dart @@ -5,14 +5,14 @@ // Test top level field. dynamic x1 = 42; // [error line 6, column 1, length 12] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 0 type arguments. class Foo { // Test class member. dynamic x2 = 42; // [error line 13, column 3, length 12] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 0 type arguments. Foo() { @@ -28,7 +28,7 @@ main() { // Test local variable. dynamic x3 = 42; // [error line 29, column 3, length 12] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 0 type arguments. print(x3); @@ -38,7 +38,7 @@ main() { // Test parameter. void foo(dynamic x4) { // [error line 39, column 10, length 12] -// [analyzer] STATIC_TYPE_WARNING.WRONG_NUMBER_OF_TYPE_ARGUMENTS +// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS // [cfe] Expected 0 type arguments. print(x4); } diff --git a/tests/language_2/variable/illegal_initializer_test.dart b/tests/language_2/variable/illegal_initializer_test.dart index 1b99406f89c..6924b691687 100644 --- a/tests/language_2/variable/illegal_initializer_test.dart +++ b/tests/language_2/variable/illegal_initializer_test.dart @@ -24,7 +24,7 @@ class B extends A { // ^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD // ^^^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER B.c3() : super; // ^ @@ -45,7 +45,7 @@ class B extends A { // ^^^^ // [analyzer] SYNTACTIC_ERROR.MISSING_ASSIGNMENT_IN_INITIALIZER // [error line 39, column 16, length 0] - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_GETTER + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER // [cfe] Expected '.' before this. // ^ // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN diff --git a/tests/language_2/variable/ref_before_declaration_test.dart b/tests/language_2/variable/ref_before_declaration_test.dart index 53f42bcff58..ee9ebc2b12e 100644 --- a/tests/language_2/variable/ref_before_declaration_test.dart +++ b/tests/language_2/variable/ref_before_declaration_test.dart @@ -76,7 +76,7 @@ class C { // ^ // [analyzer] COMPILE_TIME_ERROR.REFERENCED_BEFORE_DECLARATION // ^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT } test() { diff --git a/tests/language_2/variance/syntax/variance_type_parameter_error_syntax_test.dart b/tests/language_2/variance/syntax/variance_type_parameter_error_syntax_test.dart index 71e14caa2a9..e3e51d37349 100644 --- a/tests/language_2/variance/syntax/variance_type_parameter_error_syntax_test.dart +++ b/tests/language_2/variance/syntax/variance_type_parameter_error_syntax_test.dart @@ -17,7 +17,7 @@ void A(out int foo) { // [cfe] Expected ')' before this. List bar; // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '<' isn't defined for the class 'Type'. // ^^^ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER @@ -26,7 +26,7 @@ void A(out int foo) { // [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN // [cfe] Getter not found: 'out'. // ^ - // [analyzer] STATIC_TYPE_WARNING.UNDEFINED_OPERATOR + // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_OPERATOR // [cfe] The operator '>' isn't defined for the class 'Type'. // ^^^ // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER diff --git a/tests/language_2/variance/variance_in_inference_error_test.dart b/tests/language_2/variance/variance_in_inference_error_test.dart index 4e79966b99e..f7ab3d46226 100644 --- a/tests/language_2/variance/variance_in_inference_error_test.dart +++ b/tests/language_2/variance/variance_in_inference_error_test.dart @@ -32,7 +32,7 @@ main() { var inferredMiddle = inferContraContra(Contravariant(), Contravariant()); upper = inferredMiddle; // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // T <: Upper and T <: Lower. @@ -40,7 +40,7 @@ main() { var inferredLower = inferContraContra(Contravariant(), Contravariant()); upper = inferredLower; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // int <: T <: String is not a valid constraint. @@ -88,7 +88,7 @@ main() { var inferredContraUpper = inferContraBound(ContraBound(Lower(), (Upper x) {})); lower = inferredContraUpper; // ^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // Inference for Contrabound(...) produces Lower <: T <: Middle. @@ -96,6 +96,6 @@ main() { var inferredContraMiddle = inferContraBound(ContraBound(Lower(), (Middle x) {})); lower = inferredContraMiddle; // ^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. } diff --git a/tests/language_2/variance/variance_in_subtyping_error_test.dart b/tests/language_2/variance/variance_in_subtyping_error_test.dart index 9779d33518a..4271fd09320 100644 --- a/tests/language_2/variance/variance_in_subtyping_error_test.dart +++ b/tests/language_2/variance/variance_in_subtyping_error_test.dart @@ -70,7 +70,7 @@ main() { List> listLower = [new Contravariant()]; iterableMiddle = listLower; // ^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'List>' can't be assigned to a variable of type 'Iterable>'. testCall(listLower); diff --git a/tests/language_2/variance/variance_inout_subtyping_error_test.dart b/tests/language_2/variance/variance_inout_subtyping_error_test.dart index 3bcec37b53b..d994e6c1da7 100644 --- a/tests/language_2/variance/variance_inout_subtyping_error_test.dart +++ b/tests/language_2/variance/variance_inout_subtyping_error_test.dart @@ -108,14 +108,14 @@ main() { List> listMiddle = [new Invariant()]; iterableLower = listMiddle; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'List>' can't be assigned to a variable of type 'Iterable>'. Iterable> iterableMiddle = [new Invariant()]; List> listLower = [new Invariant()]; iterableMiddle = listLower; // ^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'List>' can't be assigned to a variable of type 'Iterable>'. testCall(listMiddle); diff --git a/tests/language_2/variance/variance_out_inference_error_test.dart b/tests/language_2/variance/variance_out_inference_error_test.dart index 809cdfb44fd..ccce0d1504f 100644 --- a/tests/language_2/variance/variance_out_inference_error_test.dart +++ b/tests/language_2/variance/variance_out_inference_error_test.dart @@ -31,7 +31,7 @@ main() { var inferredMiddle = inferCovCov(Covariant(), Covariant()); lower = inferredMiddle; // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // Lower <: T <: Upper. @@ -39,7 +39,7 @@ main() { var inferredUpper = inferCovCov(Covariant(), Covariant()); lower = inferredUpper; // ^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // Inference for Covbound(...) produces Lower <: T <: Upper. @@ -47,7 +47,7 @@ main() { var inferredCovLower = inferCovBound(CovBound(Lower(), (Upper x) {})); upper = inferredCovLower; // ^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. // Inference for Covbound(...) produces Lower <: T <: Middle. @@ -55,6 +55,6 @@ main() { var inferredCovLower2 = inferCovBound(CovBound(Lower(), (Middle x) {})); middle = inferredCovLower2; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly'. } diff --git a/tests/language_2/variance/variance_out_subtyping_error_test.dart b/tests/language_2/variance/variance_out_subtyping_error_test.dart index dd925e274ca..2ddcd3e2131 100644 --- a/tests/language_2/variance/variance_out_subtyping_error_test.dart +++ b/tests/language_2/variance/variance_out_subtyping_error_test.dart @@ -70,7 +70,7 @@ main() { List> listMiddle = [new Covariant()]; iterableLower = listMiddle; // ^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'List>' can't be assigned to a variable of type 'Iterable>'. testCall(listMiddle); diff --git a/tests/language_2/variance/variance_upper_lower_bounds_error_test.dart b/tests/language_2/variance/variance_upper_lower_bounds_error_test.dart index 2c69097d9cf..a8e1f25d021 100644 --- a/tests/language_2/variance/variance_upper_lower_bounds_error_test.dart +++ b/tests/language_2/variance/variance_upper_lower_bounds_error_test.dart @@ -28,39 +28,39 @@ main() { exactly(condition ? Contravariant() : Contravariant()); Exactly> contraUpperExpected = contraLowerActual; // ^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var contraMiddleActual = exactly(condition ? Contravariant() : Contravariant()); contraUpperExpected = contraMiddleActual; // ^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var covMiddleActual = exactly(condition ? Covariant() : Covariant()); Exactly> covLowerExpected = covMiddleActual; // ^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var covUpperActual = exactly(condition ? Covariant() : Covariant()); covLowerExpected = covUpperActual; // ^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var invObjectActual = exactly(condition ? Invariant() : Invariant()); Exactly> invMiddleExpected = invObjectActual; // ^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly>'. Exactly> invUpperExpected = invObjectActual; // ^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly>'. var legacyCovMiddleActual = @@ -68,14 +68,14 @@ main() { Exactly> legacyCovLowerExpected = legacyCovMiddleActual; // ^^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var legacyCovUpperActual = exactly(condition ? LegacyCovariant() : LegacyCovariant()); legacyCovLowerExpected = legacyCovUpperActual; // ^^^^^^^^^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var multiActual = exactly(condition @@ -83,20 +83,20 @@ main() { : Multi()); Exactly> multiExpected = multiActual; // ^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly>'. var multiActual2 = exactly( condition ? Multi() : Multi()); Exactly> multiObjectExpected = multiActual2; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly' can't be assigned to a variable of type 'Exactly>'. var multiActual3 = exactly( condition ? Multi() : Multi()); Exactly multiObjectExpected2 = multiActual3; // ^^^^^^^^^^^^ - // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT + // [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT // [cfe] A value of type 'Exactly>' can't be assigned to a variable of type 'Exactly'. } diff --git a/tests/lib/html/js_function_getter_trust_types/compile_test.dart b/tests/lib/html/js_function_getter_trust_types/compile_test.dart index 9cbbe1fd360..e7481d10079 100644 --- a/tests/lib/html/js_function_getter_trust_types/compile_test.dart +++ b/tests/lib/html/js_function_getter_trust_types/compile_test.dart @@ -18,25 +18,25 @@ main() { // ^ // [cfe] Error: 'nonFunctionStatic' isn't a function or method and can't be invoked. //^^^^^^^^^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION foo.bar.nonFunctionStatic(0); // ^ // [cfe] Error: 'nonFunctionStatic' isn't a function or method and can't be invoked. //^^^^^^^^^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION foo.bar.nonFunctionStatic(0, 0); // ^ // [cfe] Error: 'nonFunctionStatic' isn't a function or method and can't be invoked. //^^^^^^^^^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION foo.bar.nonFunctionStatic(0, 0, 0, 0, 0, 0); // ^ // [cfe] Error: 'nonFunctionStatic' isn't a function or method and can't be invoked. //^^^^^^^^^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION foo.bar.add(4); // ^ diff --git a/tests/lib_2/html/js_function_getter_trust_types/compile_test.dart b/tests/lib_2/html/js_function_getter_trust_types/compile_test.dart index 9cbbe1fd360..e7481d10079 100644 --- a/tests/lib_2/html/js_function_getter_trust_types/compile_test.dart +++ b/tests/lib_2/html/js_function_getter_trust_types/compile_test.dart @@ -18,25 +18,25 @@ main() { // ^ // [cfe] Error: 'nonFunctionStatic' isn't a function or method and can't be invoked. //^^^^^^^^^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION foo.bar.nonFunctionStatic(0); // ^ // [cfe] Error: 'nonFunctionStatic' isn't a function or method and can't be invoked. //^^^^^^^^^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION foo.bar.nonFunctionStatic(0, 0); // ^ // [cfe] Error: 'nonFunctionStatic' isn't a function or method and can't be invoked. //^^^^^^^^^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION foo.bar.nonFunctionStatic(0, 0, 0, 0, 0, 0); // ^ // [cfe] Error: 'nonFunctionStatic' isn't a function or method and can't be invoked. //^^^^^^^^^^^^^^^^^^^^^^^^^ -// [analyzer] STATIC_TYPE_WARNING.INVOCATION_OF_NON_FUNCTION_EXPRESSION +// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION foo.bar.add(4); // ^