Index: tests/compiler/dart2js_extra/if_null2_test.dart |
diff --git a/tests/language/lazy_static7_test.dart b/tests/compiler/dart2js_extra/if_null2_test.dart |
similarity index 55% |
copy from tests/language/lazy_static7_test.dart |
copy to tests/compiler/dart2js_extra/if_null2_test.dart |
index ff74912259a11aa65a3e9499f4126300a07b489d..a9923a8e773ced622b04938b114e0f6f02b3cb33 100644 |
--- a/tests/language/lazy_static7_test.dart |
+++ b/tests/compiler/dart2js_extra/if_null2_test.dart |
@@ -2,15 +2,14 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
-import "package:expect/expect.dart"; |
+/// Regression for #24134: inference was not tracking ??= correctly. |
+library tests.compiler.dart2js_extra.if_null2_test; |
-var sideEffect = 0; |
-var x = (() { sideEffect++; return 499; })(); |
+import "package:expect/expect.dart"; |
main() { |
- if (new DateTime.now().day >= -1) { |
- x = 42; |
- } |
- Expect.equals(42, x); |
- Expect.equals(0, sideEffect); |
+ var map; |
+ map ??= {}; |
+ Expect.equals(0, map.length); |
+ Expect.isTrue(map.length == 0); |
} |