-
Notifications
You must be signed in to change notification settings - Fork 136
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
[24] don't request access to enclosing class if it's never used #3194
Comments
Fixed by #3198 |
As of 24-ea+26 javac now answers:
With this shift of focus we are actually challenging a different set of rules, viz. (spec version 20241101):
So we proceed to 15.9.2 as if
With our example:
Ergo: we should raise an error (reminder to self: conversely, also the error on |
Fixes after re-opening: + essentially revert previous change + replace with specific detection wrt local type alloc in static context Fixes eclipse-jdt#3194
The following case which is accepted in master is now rejected in BETA_JAVA24:
@stephan-herrmann let me know if you would prefer a new issue. |
reproduced, thanks for catching
I'm fine with fixing the regression via the same issue. |
Fixes after re-opening: + essentially revert previous change + replace with specific detection wrt local type alloc in static context Fixes eclipse-jdt#3194
It seems this is already fixed in #3390, just that fix is blocked since two weeks due to broken baseline checks causing the build to fail, see eclipse-platform/eclipse.platform.releng.aggregator#2660 |
+ additional test Fixes eclipse-jdt#3194
Fixes after re-opening: + essentially revert previous change + replace with specific detection wrt local type alloc in static context Fixes eclipse-jdt#3194
+ additional test Fixes eclipse-jdt#3194
* [24] don't request access to enclosing class if it's never used Fixes after re-opening: + essentially revert previous change + replace with specific detection wrt local type alloc in static context Fixes #3194 * [24] don't request access to enclosing class if it's never used + additional test Fixes #3194
Given this example:
ecj complains against
Foo::new
:The message is true, but the ctor of Foo does not need that enclosing instance. This would only be the case when, e.g., the invocation
m()
is uncommented.This shows that the mechanics introduced for flexible constructors creates synthetic arguments where none are needed (which then causes an error, when no value can be supplied to that synthetic argument).
The text was updated successfully, but these errors were encountered: