Draft JEP for Third Preview of Primitive Types in Patterns, instanceof, and switch
Remi Forax
forax at univ-mlv.fr
Wed Apr 2 15:49:48 UTC 2025
> From: "Angelos Bimpoudis" <angelos.bimpoudis at oracle.com>
> To: "amber-spec-experts" <amber-spec-experts at openjdk.org>
> Sent: Wednesday, April 2, 2025 4:51:59 PM
> Subject: Draft JEP for Third Preview of Primitive Types in Patterns, instanceof,
> and switch
> Dear experts,
> A draft JEP for the third preview of primitive types in patterns, instanceof,
> and switch is now available and submitted. We propose to preview it for a third
> time with no changes relative to JDK 24.
> https://openjdk.org/jeps/8349215
> To recall, this feature drops restrictions around switch and instanceof. During
> the evolution of this feature we established new terminology and functionality
> to safeguard against loss of information or other exceptional cases across all
> types, uniformly. One of the goals of this feature is to not introduce new
> conversions, rather to safeguard against all existing ones. Re-previewing as is
> for the third time gives us the opportunity to examine Chapter 5 of the JLS
> holistically and identify opportunities that could pave the road to other
> potential language features, e.g., constant patterns, null-restricted value
> class types etc.
There is another dependency, in Valhalla, at some point we will want to "merge" primiitive types and values types, primitive types becoming a subset of value types.
There are nice ideas floating around, but as far as i know, that part is not fully fledged,
so if we move too quickly here, the primitive type patterns of today may become a problem of tomorrow.
> Thank you,
> Angelos
regards,
Rémi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-spec-experts/attachments/20250402/cdda9f76/attachment.htm>
More information about the amber-spec-experts
mailing list