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

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Dec 6 13:49:01 UTC 2019


Hi,
few comments:

* is the call to checkSourceLevel needed? After all you already check 
for enable-preview

* 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).

Maurizio

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