Pattern matching: next steps after JEP 405
Brian Goetz
brian.goetz at oracle.com
Fri May 20 13:05:26 UTC 2022
I'm sorry, I have no idea what argument you are trying to make. Start
from the beginning.
On 5/20/2022 1:27 AM, forax at univ-mlv.fr wrote:
>
>
> ------------------------------------------------------------------------
>
> *From: *"Brian Goetz" <brian.goetz at oracle.com>
> *To: *"Remi Forax" <forax at univ-mlv.fr>
> *Cc: *"amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> *Sent: *Thursday, May 19, 2022 3:05:07 PM
> *Subject: *Re: Pattern matching: next steps after JEP 405
>
>
>
> When you have a type pattern X in a middle of a pattern *and*
> you have conversions, then there is an ambiguity,
> does instanceof Box(X x) means
> Box(var v) && v instanceof X x
> or
> Box(var v) && X x = (X) v;
>
>
> This is not an ambiguity in the language, it is confusion on the
> part of the reader :)
>
> In any case, I'm not following your argument here.
>
>
> If you have both a type pattern and allow conversions, you have
> Box(X) is equivalent to Box(var v) && v instanceof Y y && X x = (X) y
>
> How do you find Y ?
>
> And yes, the bar is not only that Y has to be unique for the compiler,
> it has also to be obvious for the human reader too.
>
> Rémi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20220520/9f6485cd/attachment-0001.htm>
More information about the amber-spec-experts
mailing list