RFR: 8254105: allow static nested declarations [v4]

Vicente Romero vromero at openjdk.java.net
Tue Nov 3 19:25:17 UTC 2020

On Tue, 3 Nov 2020 17:18:36 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> The changes look good, but I have one concern: this patch seem to apply the improvements unconditionally, regardless of the source version - is this what we want? While I understand that the risk is low (this patch makes space of compilable programs bigger), at the same times it feels wrong that when compiling with `--source 14` I can now nest static classes inside member classes (which is not compatible with what the SE 14 spec says).
>> As @mcimadamore, I think this should only be allowed for -source 16+, right?
> I agree, I'm working on another iteration to fix the issue, thanks for the comments

I have pushed a commit addressing the review comments so far. I have re-added code in Attr but this time behind a guard checking if records are allowed in the current source and I have added back some tests I removed before. The tests are now executed with current source and with source 15. Thanks for the comments so far.


PR: https://git.openjdk.java.net/jdk/pull/571

More information about the compiler-dev mailing list