Index: pkg/analyzer/test/generated/non_error_resolver_test.dart |
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart |
index 43775da08119b196a4a18cf6f1a11eb728a6a1aa..33b976963652a1765af50daca70d7932486d3fc3 100644 |
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart |
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart |
@@ -6,6 +6,7 @@ library engine.non_error_resolver_test; |
import 'package:analyzer/src/generated/ast.dart'; |
import 'package:analyzer/src/generated/element.dart'; |
+import 'package:analyzer/src/generated/engine.dart'; |
import 'package:analyzer/src/generated/error.dart'; |
import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
import 'package:analyzer/src/generated/source_io.dart'; |
@@ -2307,6 +2308,36 @@ f([String x = '0']) { |
verify([source]); |
} |
+ void test_invalidAssignment_ifNullAssignment_compatibleType() { |
+ AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
+ options.enableNullAwareOperators = true; |
+ resetWithOptions(options); |
+ Source source = addSource(''' |
+void f(int i) { |
+ num n; |
+ n ??= i; |
+} |
+'''); |
+ resolve(source); |
+ assertNoErrors(source); |
+ verify([source]); |
+ } |
+ |
+ void test_invalidAssignment_ifNullAssignment_sameType() { |
+ AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
+ options.enableNullAwareOperators = true; |
+ resetWithOptions(options); |
+ Source source = addSource(''' |
+void f(int i) { |
+ int j; |
+ j ??= i; |
+} |
+'''); |
+ resolve(source); |
+ assertNoErrors(source); |
+ verify([source]); |
+ } |
+ |
void test_invalidAssignment_implicitlyImplementFunctionViaCall_1() { |
// 18341 |
// |