[patterns-switch] Draft Spec for JEP 420: Pattern Matching for switch (Second Preview)

2021-10-20 Thread Gavin Bierman
Dear experts: The first draft of the spec for JEP 420 (Pattern Matching for switch - Second Preview) is now available at: http://cr.openjdk.java.net/~gbierman/jep420/latest/ This contains the updates discussed on the list (GADT support, revised dominance rules for constant case labels etc

Re: Pattern Matching for switch (Second Preview)

2021-10-01 Thread Remi Forax
> From: "Gavin Bierman" > To: "Brian Goetz" > Cc: "amber-spec-experts" > Sent: Vendredi 1 Octobre 2021 14:49:01 > Subject: Re: Pattern Matching for switch (Second Preview) >> On 30 Sep 2021, at 23:25, Brian Goetz < [ mailto:brian.

Re: Pattern Matching for switch (Second Preview)

2021-10-01 Thread Gavin Bierman
On 30 Sep 2021, at 23:25, Brian Goetz mailto:brian.go...@oracle.com>> wrote: [ moving to a-s-e ] I get the concern that a type pattern is no longer "just a variable declaration"; that was a nice part of the "patterns aren't really so hard to understand" story. But I think the usability is

Re: Pattern Matching for switch (Second Preview)

2021-09-30 Thread Remi Forax
> From: "Brian Goetz" > To: "Gavin Bierman" > Cc: "amber-spec-experts" > Sent: Vendredi 1 Octobre 2021 00:25:26 > Subject: Re: Pattern Matching for switch (Second Preview) > [ moving to a-s-e ] > I get the concern that a type

Re: Pattern Matching for switch (Second Preview)

2021-09-30 Thread Brian Goetz
[ moving to a-s-e ] I get the concern that a type pattern is no longer "just a variable declaration"; that was a nice part of the "patterns aren't really so hard to understand" story.  But I think the usability is likely to be not very good.  Take this example:     sealed interface Node { }