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

Unified Diff: tests/compiler/dart2js/constant_expression_evaluate_test.dart

Issue 2104843002: Handle fields with initializers in constant constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix invariants. 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 | « pkg/compiler/lib/src/resolution/resolution.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/constant_expression_evaluate_test.dart
diff --git a/tests/compiler/dart2js/constant_expression_evaluate_test.dart b/tests/compiler/dart2js/constant_expression_evaluate_test.dart
index fde84c359481a4b2e8de4e10f9ce2d80fec90364..49f3b51fe88eea9b2fc0992e85b1f2e8ab018350 100644
--- a/tests/compiler/dart2js/constant_expression_evaluate_test.dart
+++ b/tests/compiler/dart2js/constant_expression_evaluate_test.dart
@@ -108,6 +108,10 @@ class C extends B {
const C({field1: 42, this.field2: false}) : super(field1);
const C.named([field = false]) : this(field1: field, field2: field);
}
+class D extends C {
+ final field3 = 99;
+ const D(a, b) : super(field2: a, field1: b);
+}
''', const [
const ConstantData('const Object()',
const { const {} : 'ConstructedConstant(Object())' }),
@@ -140,6 +144,10 @@ class C extends B {
const {'foo': 'false', 'bar': '87'} :
'ConstructedConstant(C(field1=BoolConstant(false),'
'field2=IntConstant(87)))', }),
+ const ConstantData('const D(42, 87)', const { const {} :
+ 'ConstructedConstant(D(field1=IntConstant(87),'
+ 'field2=IntConstant(42),'
+ 'field3=IntConstant(99)))' }),
]),
const TestData('''
class A<T> implements B {
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698