`case null:` (here we go)

forax at univ-mlv.fr forax at univ-mlv.fr
Wed May 2 17:03:54 UTC 2018


> De: "Brian Goetz" <brian.goetz at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "Kevin Bourrillion" <kevinb at google.com>, "amber-spec-experts"
> <amber-spec-experts at openjdk.java.net>
> Envoyé: Mercredi 2 Mai 2018 14:14:33
> Objet: Re: `case null:` (here we go)

> I think this is a little too strong. default is associated with switch, and we
> probably do need to massage switch’s handling of default, but we don’t need to
> make it a full blown pattern. And we probably don’t want to; saying

> case Foo(default): …

> or

> if (x instanceof Bar(default))

> doesn’t make much sense.

default can be a primary pattern without being a secondary pattern, i.e not available when matching something extracted, in term of grammar those can be separated. 

> So I agree it should be rehabilitated, but not by quite that much.

>> Now that we have decided that the -> syntax doesn't allow fallthrough, i think
>> we have no choice but to allow, default has a possible 'Pattern' in the
>> grammar.

Rémi 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20180502/2ce93168/attachment.html>


More information about the amber-spec-experts mailing list