Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow lambdas in this()/super() to close over outer types #10078

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

niloc132
Copy link
Member

@niloc132 niloc132 commented Jan 8, 2025

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

@niloc132 niloc132 added this to the 2.13 milestone Jan 8, 2025
@niloc132
Copy link
Member Author

niloc132 commented Jan 8, 2025

Passing full CI build https://github.com/niloc132/gwt/actions/runs/12663353268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants