Is 'record' a restricted type name since 13, right?

Alex Buckley alex.buckley at oracle.com
Thu Feb 20 17:59:36 UTC 2020


The jshell error message is wrong -- it should say "as of release 14". 
Java SE 13 / JLS13 had no notion of records.

Alex

On 2/19/2020 11:48 PM, kishida naoki wrote:
> On JDK 14.ea.36, Using 'record' as a type name with '--enable-preview'
> produces a message as below.
> But I can't find any specification to restrict 'record' on the JLS 13.
> Is the message true, or where can I find the description?
> 
> ```
> $ jshell --enable-preview
> |  Welcome to JShell -- Version 14
> |  For an introduction type: /help intro
> 
> jshell> class record{}
> |  Error:
> |  'record' not allowed here
> |    as of release 13, 'record' is a restricted type name and cannot be
> used for type declarations
> |  class record{}
> |        ^
> ```
> 


More information about the amber-dev mailing list