-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Fix closure conversion in field and local initializers."
This reverts commit a49dcb6. Review-Url: https://codereview.chromium.org/2974673002 .
- Loading branch information
1 parent
73ec7f0
commit a7d1837
Showing
6 changed files
with
38 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
pkg/kernel/test/closures_initializers/closures_initializers.status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | ||
# for details. All rights reserved. Use of this source code is governed by a | ||
# BSD-style license that can be found in the LICENSE.md file. | ||
|
||
local_initializers: Crash |
35 changes: 0 additions & 35 deletions
35
pkg/kernel/testcases/closures_initializers/initializers.dart
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
pkg/kernel/testcases/closures_initializers/initializers.dart.expect
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
pkg/kernel/testcases/closures_initializers/local_initializers.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | ||
// 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. | ||
|
||
// The purpose of this test is to detect that closures in [LocalInitializer]s | ||
// are properly converted. This test assumes that | ||
// [ArgumentExtractionForRedirecting] transformer was run before closure | ||
// conversion. It should introduce one [LocalInitializer] for each argument | ||
// passed to the redirecting constructor. If such argument contains a closure, | ||
// it would appear in a [LocalInitializer]. | ||
|
||
class X {} | ||
|
||
class A { | ||
X foo; | ||
A.named(X foo) {} | ||
A(X foo) : this.named((() => foo)()); | ||
} | ||
|
||
main() { | ||
A a = new A(new X()); | ||
a.foo; // To prevent dartanalyzer from marking [a] as unused. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters