Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1534)

Unified Diff: tests/compiler/dart2js/serialization/test_data.dart

Issue 2116483002: Handle constant ?? expressions in constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/constant_expression_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/serialization/test_data.dart
diff --git a/tests/compiler/dart2js/serialization/test_data.dart b/tests/compiler/dart2js/serialization/test_data.dart
index 74ec44f5c161a0f2d9b43ccc4aa1280b0d89dbdb..5e3c9bbec7d27cf99d8d55d6e41b84073cc09b0a 100644
--- a/tests/compiler/dart2js/serialization/test_data.dart
+++ b/tests/compiler/dart2js/serialization/test_data.dart
@@ -455,6 +455,23 @@ class A {
''',
}),
+ const Test('If-null expression in constant constructor', const {
+ 'main.dart': '''
+import 'a.dart';
+
+main() {
+ const A(1.0);
+}
+''',
+ }, preserializedSourceFiles: const {
+ 'a.dart': '''
+class A {
+ final field1;
+ const A(a) : this.field1 = a ?? 1.0;
+}
+''',
+ }),
+
const Test('Index set if null', const {
'main.dart': '''
import 'a.dart';
« no previous file with comments | « tests/compiler/dart2js/constant_expression_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698