Index: pkg/analyzer/test/generated/compile_time_error_code_test.dart |
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 cdea519d74a2d39f3dde614ac856675659726d09..cfc2f626a02c90f30962199c809c242e234c53f9 100644 |
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart |
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart |
@@ -4705,6 +4705,66 @@ part 'test.dart';'''); |
verify([source]); |
} |
+ void test_prefix_assignment_compound_in_method() { |
+ addNamedSource('/lib.dart', 'library lib;'); |
+ Source source = addSource(''' |
+import 'lib.dart' as p; |
+class C { |
+ f() { |
+ p += 1; |
+ } |
+} |
+'''); |
+ computeLibrarySourceErrors(source); |
+ assertErrors( |
+ source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]); |
+ verify([source]); |
+ } |
+ |
+ void test_prefix_assignment_compound_not_in_method() { |
+ addNamedSource('/lib.dart', 'library lib;'); |
+ Source source = addSource(''' |
+import 'lib.dart' as p; |
+f() { |
+ p += 1; |
+} |
+'''); |
+ computeLibrarySourceErrors(source); |
+ assertErrors( |
+ source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]); |
+ verify([source]); |
+ } |
+ |
+ void test_prefix_assignment_in_method() { |
+ addNamedSource('/lib.dart', 'library lib;'); |
+ Source source = addSource(''' |
+import 'lib.dart' as p; |
+class C { |
+ f() { |
+ p = 1; |
+ } |
+} |
+'''); |
+ computeLibrarySourceErrors(source); |
+ assertErrors( |
+ source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]); |
+ verify([source]); |
+ } |
+ |
+ void test_prefix_assignment_not_in_method() { |
+ addNamedSource('/lib.dart', 'library lib;'); |
+ Source source = addSource(''' |
+import 'lib.dart' as p; |
+f() { |
+ p = 1; |
+} |
+'''); |
+ computeLibrarySourceErrors(source); |
+ assertErrors( |
+ source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]); |
+ verify([source]); |
+ } |
+ |
void test_prefix_conditionalPropertyAccess_call() { |
AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
options.enableNullAwareOperators = true; |
@@ -4822,6 +4882,36 @@ f() { |
verify([source]); |
} |
+ void test_prefix_unqualified_invocation_in_method() { |
+ addNamedSource('/lib.dart', 'librarylib;'); |
+ Source source = addSource(''' |
+import 'lib.dart' as p; |
+class C { |
+ f() { |
+ p(); |
+ } |
+} |
+'''); |
+ computeLibrarySourceErrors(source); |
+ assertErrors( |
+ source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]); |
+ verify([source]); |
+ } |
+ |
+ void test_prefix_unqualified_invocation_not_in_method() { |
+ addNamedSource('/lib.dart', 'librarylib;'); |
+ Source source = addSource(''' |
+import 'lib.dart' as p; |
+f() { |
+ p(); |
+} |
+'''); |
+ computeLibrarySourceErrors(source); |
+ assertErrors( |
+ source, [CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT]); |
+ verify([source]); |
+ } |
+ |
void test_prefixCollidesWithTopLevelMembers_functionTypeAlias() { |
addNamedSource("/lib.dart", r''' |
library lib; |