Index: tests/language_strong/nullaware_opt_test.dart |
diff --git a/tests/language_strong/nullaware_opt_test.dart b/tests/language_strong/nullaware_opt_test.dart |
index 0436e8b2aac64106d1412e233176264a36566ad2..017ae4c433cef6885a5e7101a427f24e81779e98 100644 |
--- a/tests/language_strong/nullaware_opt_test.dart |
+++ b/tests/language_strong/nullaware_opt_test.dart |
@@ -79,10 +79,20 @@ class Foo { |
Foo(this._bar) : str = _bar?.s; |
} |
+// Check that ?? isn't incorrectly optimized as non-nullable |
+// (DDC regression test) |
+test3() { |
+ List n = null; |
+ var func = n?.add; |
+ var result = func ?? 1; |
+ Expect.equals(result, 1); |
+} |
+ |
main() { |
for (int i = 0; i < 10; i++) { |
test(); |
test2(); |
+ test3(); |
} |
Expect.equals(null, new Foo(new Bar()).str); |