> De: "Brian Goetz" <brian.go...@oracle.com>
> À: "Remi Forax" <fo...@univ-mlv.fr>
> Cc: "Kevin Bourrillion" <kev...@google.com>, "amber-spec-experts"
> <amber-spec-experts@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 

Reply via email to