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

kishida naoki naokikishida at
Thu Feb 20 07:48:00 UTC 2020

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{}
|        ^

Naoki Kishida

More information about the amber-dev mailing list