An errata about the production rule w.r.t. "CaseConstant" in JLS 14.11.1 Switch Blocks (Java SE 14 & 15)

Brian Jeong math.physics.computer at gmail.com
Wed Oct 21 22:05:05 UTC 2020


The production rule w.r.t. the non-terminal symbol "CaseConstant" in JLS
14.11.1 Switch Blocks  (Java SE 14
<https://docs.oracle.com/javase/specs/jls/se14/html/jls-14.html#jls-14.11.1>
& 15
<https://docs.oracle.com/javase/specs/jls/se15/html/jls-14.html#jls-14.11.1>)
is given as:


*CaseConstant:ConditionalExpression*

However, this doesn't seem to meet the sentence:

*Every case constant must be either a constant expression (§15.29) or the
name of an enum constant (§8.9.1), or a compile-time error occurs*.

It looks like a minor erratum, which can be corrected as:






*CaseConstant:ConstantExpressionEnumConstantNameEnumConstantName:Identifier*

Please review this.
Thanks,

- Brian


More information about the jls-jvms-spec-comments mailing list