Index: pkg/analyzer/test/generated/static_warning_code_test.dart |
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart |
index 0ad381f9e0a1aa34906c462ef7e3a367339bab9a..6df4785a2bf39394eedc1d301f1b442a268d8c06 100644 |
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart |
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart |
@@ -598,6 +598,17 @@ main() { |
verify([source]); |
} |
+ void test_assignmentToClass() { |
+ Source source = addSource(''' |
+class C {} |
+main() { |
+ C = null; |
+} |
+'''); |
+ resolve(source); |
+ assertErrors(source, [StaticWarningCode.ASSIGNMENT_TO_TYPE]); |
+ } |
+ |
void test_assignmentToConst_instanceVariable() { |
Source source = addSource(r''' |
class A { |
@@ -646,6 +657,17 @@ f() { |
verify([source]); |
} |
+ void test_assignmentToEnumType() { |
+ Source source = addSource(''' |
+enum E { e } |
+main() { |
+ E = null; |
+} |
+'''); |
+ resolve(source); |
+ assertErrors(source, [StaticWarningCode.ASSIGNMENT_TO_TYPE]); |
+ } |
+ |
void test_assignmentToFinal_instanceVariable() { |
Source source = addSource(r''' |
class A { |
@@ -825,6 +847,29 @@ f(A a) { |
verify([source]); |
} |
+ void test_assignmentToTypedef() { |
+ Source source = addSource(''' |
+typedef void F(); |
+main() { |
+ F = null; |
+} |
+'''); |
+ resolve(source); |
+ assertErrors(source, [StaticWarningCode.ASSIGNMENT_TO_TYPE]); |
+ } |
+ |
+ void test_assignmentToTypeParameter() { |
+ Source source = addSource(''' |
+class C<T> { |
+ f() { |
+ T = null; |
+ } |
+} |
+'''); |
+ resolve(source); |
+ assertErrors(source, [StaticWarningCode.ASSIGNMENT_TO_TYPE]); |
+ } |
+ |
void test_caseBlockNotTerminated() { |
Source source = addSource(r''' |
f(int p) { |