-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow lambdas in this()/super() to close over outer types (#10078)
Prior to JDT 3.32, passing a lambda that closes over outer types to this()/super() constructors would result in a compiler error. As of around 3.32 this is now allowed, but the closed-over instance is passed as an item in a "synthetic outer local variable" collection. Each instance in that collection has a field representing the "actual outer local variable", and in this case, that field is null. Added tests to confirm that the generated code seems consistent, and that running such a lambda affects the expected instance. Fixes #10065
- Loading branch information
Showing
3 changed files
with
121 additions
and
1 deletion.
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
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
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