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

Side by Side Diff: pkg/kernel/testcases/closures_initializers/local_initializers.dart

Issue 2944433002: Add tests for handling closures in LocalInitializers (Closed)
Patch Set: Merge in latest changes in master (e340ee517a) Created 3 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // The purpose of this test is to detect that closures in [LocalInitializer]s
6 // are properly converted. This test assumes that
7 // [ArgumentExtractionForRedirecting] transformer was run before closure
8 // conversion. It should introduce one [LocalInitializer] for each argument
9 // passed to the redirecting constructor. If such argument contains a closure,
10 // it would appear in a [LocalInitializer].
11
12 class X {}
13
14 class A {
15 X foo;
16 A.named(X foo) {}
17 A(X foo) : this.named((() => foo)());
18 }
19
20 main() {
21 A a = new A(new X());
22 a.foo; // To prevent dartanalyzer from marking [a] as unused.
23 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698