Re: Named record pattern

2022-05-31 Thread Remi Forax
> From: "Maurizio Cimadamore" > To: "Brian Goetz" , "Tagir Valeev" > Cc: "amber-spec-experts" > Sent: Tuesday, May 31, 2022 7:41:21 PM > Subject: Re: Named record pattern > While merging is an issue (if supported), I think early in the design we > settled > on the principle that a binding vari

Re: Named record pattern

2022-05-31 Thread Maurizio Cimadamore
While merging is an issue (if supported), I think early in the design we settled on the principle that a binding variable should always only have /one/ corresponding declaration (in the places where it is defined). So, from a language perspective, I don’t see an immediate problem, in the sense

Re: Named record pattern

2022-05-31 Thread Brian Goetz
Gavin reminded me that we are not finalizing patterns in switch in 19 (hard to keep track, sometimes), so we have a little bit of time to figure out what we want here. One thing that is potentially confusing is that patterns work indirectly in a number of ways.  For example, if we have a decla

Re: Named record pattern

2022-05-31 Thread Brian Goetz
Erm... I actually thought that it was your idea to allow the 'final' modifier on patterns. This change was introduced in Java 16 (when patterns for instanceof were finalized). Here's the initial e-mail from you (item 2): https://mail.openjdk.java.net/pipermail/amber-spec-experts/2020-August/00

Re: Named record pattern

2022-05-31 Thread Tagir Valeev
Hello! On Mon, May 30, 2022 at 6:54 PM Brian Goetz wrote: > I must admit to being very surprised that you can do this at all! I > don't recall discussion on this, and had you asked me, I would have said > that `final` has no place in type-test patterns. Yet, I just tried it > with jshell and it