Index: pkg/kernel/testcases/closures_initializers/local_initializers.dart |
diff --git a/pkg/kernel/testcases/closures_initializers/local_initializers.dart b/pkg/kernel/testcases/closures_initializers/local_initializers.dart |
index d8df32d5b6665e5dcbac5d41ab79e9cc54943740..84d336bd421e88e0ceb225972658e59b8667cd7e 100644 |
--- a/pkg/kernel/testcases/closures_initializers/local_initializers.dart |
+++ b/pkg/kernel/testcases/closures_initializers/local_initializers.dart |
@@ -11,13 +11,24 @@ |
class X {} |
+// Closure in field initializer. |
Dmitry Stefantsov
2017/07/07 09:47:47
I would split this test in two or change the name
|
+// |
class A { |
X foo; |
- A.named(X foo) {} |
- A(X foo) : this.named((() => foo)()); |
+ A(X i) : foo = ((() => i)()); |
+} |
+ |
+// Closure in local initializer. |
+// |
+class B { |
+ X foo; |
+ B.named(X foo) {} |
+ B(X foo) : this.named((() => foo)()); |
} |
main() { |
A a = new A(new X()); |
a.foo; // To prevent dartanalyzer from marking [a] as unused. |
+ B b = new B(new X()); |
+ b.foo; |
} |