-
Notifications
You must be signed in to change notification settings - Fork 130
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
[23] super reference disallowed in the context of a field access #3094
Comments
I don't know if this is related, but the following code is rejected too:
|
Here's another variant:
|
@jarthana Which field should |
Yeah, I was just playing around and was too eager to report. Let me get back on this. |
The naked eye doesn't even see any early construction context (and --enable-preview is not needed for javac). So this part looks buggy ...
"intricacies" is a good word here :) This version seems to be equivalent, and is accepted by ecj:
(qualifying the inherited field is not necessary). Read: when going from DeeplyNested to its super NestedInX1 we need one additional enclosing instance which is provided as |
+ distinguish super vs. outer type for early constr. check fixes eclipse-jdt#3094
+ distinguish super vs. outer type for early constr. check fixes #3094
For this I filed #3132 |
Here's the testcase:
The error reported is
Cannot use 'Nested.super' in an early construction context (except in a simple field assignment)
I don't really know the intricacies here and Javac allows this code.
Copying @mpalat and @stephan-herrmann
The text was updated successfully, but these errors were encountered: