[External] : Re: Relaxed assignment conversions for sealed types

Brian Goetz brian.goetz at oracle.com
Mon Jan 25 13:00:38 UTC 2021



>     I think these things are the same feature.  So what if:
>
>         total-switch (x) { ... }  // or switch-total
>
>     meant "I assert this switch is total, please error if it is not." 
>
>
> Just from a pure syntax POV, i wonder if
>   switch(total x) { ... }
> is not more in line with the other usages.
>
> It's just a trick but it looks more like a keyword that a special switch.

Yep, a possibility.  In the other cases total modifies a type, not an 
expression, which is a little bit of a stretch here, but probably workable.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20210125/ea38a74c/attachment.htm>


More information about the amber-spec-experts mailing list