REF: JDK-8235446: confusing error message for records with no parens

Vicente Romero vicente.romero at oracle.com
Fri Dec 6 14:19:16 UTC 2019



On 12/6/19 8:49 AM, Maurizio Cimadamore wrote:
> Hi,
> few comments:
>
> * is the call to checkSourceLevel needed? After all you already check 
> for enable-preview

the thing is that checkSourceLevel prints the warning messages that you 
are using a preview feature etc, that's why I put it there

>
> * I think the error message should just be:
>
> "record components expected"
>
> (and perhaps we should move the position of the error message to 
> _after_ the record keyword).

ok changing the error message to: "record header expected"
>
> Maurizio

Thanks,
Vicente

>
> On 06/12/2019 12:21, Vicente Romero wrote:
>> Please review this simple fix [1] to a bug [2] reported yesterday on 
>> amber-dev by Tagir. This fix is just improving the current error 
>> message shown for code like:
>>
>> record R {}
>>
>> instead of the current: class, record, etc expected it prints: 
>> "incorrect record declaration", how does it looks?
>>
>> Thanks,
>> Vicente
>>
>> [1] http://cr.openjdk.java.net/~vromero/8235446/webrev.00/
>> [2] https://bugs.openjdk.java.net/browse/JDK-8235446



More information about the compiler-dev mailing list