JEP proposed to target JDK 17: 406: Pattern Matching for switch (Preview)
Remi Forax
forax at univ-mlv.fr
Fri May 21 07:07:34 UTC 2021
----- Mail original -----
> De: "Mike Rettig" <mike.rettig at gmail.com>
> À: "jdk-dev" <jdk-dev at openjdk.java.net>
> Envoyé: Vendredi 21 Mai 2021 00:48:18
> Objet: Re: JEP proposed to target JDK 17: 406: Pattern Matching for switch (Preview)
> Will non-expression switches be exhaustive? I know that this has been
> discussed but I wanted to confirm the behavior for jdk 17.
>
> https://mail.openjdk.java.net/pipermail/amber-spec-experts/2021-April/002959.html
>
> Sealed classes will be far more useful with exhaustiveness.
yes,
see 15.28.1 of the current spec [1].
>
> Thanks,
>
> Mike
regards,
Rémi
[1] https://cr.openjdk.java.net/~gbierman/jep406/jep406-20210514/specs/patterns-switch-jls.html
More information about the jdk-dev
mailing list