RFR: JDK-8235778: No compilation error reported when a record is declared in a local class
Vicente Romero
vicente.romero at oracle.com
Thu Dec 12 00:40:01 UTC 2019
I have uploaded a new iteration at [1],
Thanks for your comments,
Vicente
[1] http://cr.openjdk.java.net/~vromero/8235778/webrev.01/
On 12/11/19 7:08 PM, Maurizio Cimadamore wrote:
>
> If sym.isLocal() returns true, is this check
>
> && (sym.owner.flags_field & STATIC) == 0)
> Needed? Aren't we inside a record declaration that is contained in
> some local context (e.g. within a method body), whose immediate
> enclosing type is a type T? If so, isn't T always non-static? I guess
> yes, unless T is a record itself, like:
>
> void m() {
> record A() {
> record B() { }
> }
> }
>
> The patch seems to be biased in favor of this - is it deliberate?
> (also there's no test around that). Should the spec say something?
>
> Maurizio
>
> On 11/12/2019 23:39, Vicente Romero wrote:
>> Hi,
>>
>> Please review the fix for [1] at [2]. Records are not allowed to be
>> defined inside inner classes. This patch extends the check to local
>> inner classes which was missing.
>>
>> Thanks,
>> Vicente
>>
>> https://bugs.openjdk.java.net/browse/JDK-8235778
>> http://cr.openjdk.java.net/~vromero/8235778/webrev.00/
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20191211/3e6709c1/attachment.htm>
More information about the compiler-dev
mailing list