JEP 455: JLS change for switch expressions
Angelos Bimpoudis
angelos.bimpoudis at oracle.com
Wed Oct 18 22:24:40 UTC 2023
Correct and good catch!
Spec updated.
Many thanks 🚀
________________________________
From: Yuriy Maslyanko <yuriy.maslyanko at oracle.com>
Sent: 18 October 2023 23:38
To: Angelos Bimpoudis <angelos.bimpoudis at oracle.com>
Cc: compiler-dev at openjdk.org <compiler-dev at openjdk.org>
Subject: JEP 455: JLS change for switch expressions
Hi Angelos,
JCK team started working on JEP 455: Primitive types in Patterns, instanceof, and switch (Preview). Just noticed that in the draft spec, https://cr.openjdk.org/~abimpoudis/instanceof/jep443-20231010/specs/instanceof-jls.html, there is a change for the switch statement:
14.11 The switch Statement
The Expression is called the selector expression. The type of the selector expression must be char, byte, short, int, or a reference type, or a compile-time error occurs. (jls-14.11-200)
->
The Expression is called the selector expression. The type of the selector expression can be either a primitive or a reference type.
But the corresponding assertion for switch expressions is not changed:
15.28. switch Expressions
The Expression is called the selector expression. The type of the selector expression must be char, byte, short, int, or a reference type, or a compile-time error occurs. (jls-15.28-200)
Could you please take a look?
Thanks,
Yuriy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20231018/d8fe58b0/attachment-0001.htm>
More information about the compiler-dev
mailing list