Updated patterns-in-switch doc
Remi Forax
forax at univ-mlv.fr
Sun Sep 13 12:08:19 UTC 2020
Section Do we need constant patterns,
if we don't have constant pattern, it may also means that the type of a bound variables can be implicit too.
i.e. case Point(x, y) having the same meaning as case Point(var x, var y) like with lambdas.
Because
int c = ...
switch(getFoo()) {
case Foo(c): ...
}
is not valid anymore and should be written like this
int c = ...
switch(getFoo()) {
case Foo(x) where x == c: ...
}
Rémi
> De: "Brian Goetz" <brian.goetz at oracle.com>
> À: "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> Envoyé: Mardi 8 Septembre 2020 18:43:01
> Objet: Updated patterns-in-switch doc
> I have updated
> [
> https://github.com/openjdk/amber-docs/blob/master/site/design-notes/type-patterns-in-switch.md
> |
> https://github.com/openjdk/amber-docs/blob/master/site/design-notes/type-patterns-in-switch.md
> ]
> based on our discussions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20200913/6408f4bc/attachment.htm>
More information about the amber-spec-experts
mailing list