expression switch vs. procedural switch

John Rose john.r.rose at oracle.com
Wed Mar 14 00:27:20 UTC 2018


On Mar 13, 2018, at 5:23 PM, John Rose <john.r.rose at oracle.com> wrote:
> 
> Also, even for e-switches an explicit exhaustiveness marker is
> desirable.  For both kinds of switches, there are cases where
> the user wants to say, "I know I have covered all the possibilities"
> and thus turn off the effects of exhaustiveness checking, including
> DA rules and whatever DA-like rule we define for e-switches.

P.S. You probably surmised, correctly, that this involves injecting
an implicit exception throw, at an implicit default.  Whether the
compiler asserts exhaustivness from type analysis, or the user
asserts it just because, the runtime has to have a backup plan
to throw a MatchError or SurpriseInSwitchError, to keep the
JVM's verifier happy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20180313/6adcd523/attachment.html>


More information about the amber-spec-experts mailing list