Re: [External] : Re: case null and type pattern

2021-07-20 Thread forax
> From: "Brian Goetz" > To: "Remi Forax" > Cc: "Gavin Bierman" , "Manoj Palat" > , "amber-spec-experts" > > Sent: Lundi 19 Juillet 2021 15:49:22 > Subject: Re: [External] : Re: case null and type pattern > Sur

Re: [External] : Re: case null and type pattern

2021-07-19 Thread Brian Goetz
: *From: *"Brian Goetz" *To: *"Gavin Bierman" , "Manoj Palat" *Cc: *"amber-spec-experts" *Sent: *Lundi 19 Juillet 2021 15:00:16 *Subject: *Re: case null and

Re: case null and type pattern

2021-07-19 Thread Remi Forax
> From: "Brian Goetz" > To: "Gavin Bierman" , "Manoj Palat" > > Cc: "amber-spec-experts" > Sent: Lundi 19 Juillet 2021 15:00:16 > Subject: Re: case null and type pattern > Right. In theory, we could allow guarded patterns here, bu

Re: case null and type pattern

2021-07-19 Thread Brian Goetz
Right.  In theory, we could allow guarded patterns here, but they will be hard to use, since users will likely want to use the binding in the guard, and would have to check for nullity every time. On 7/19/2021 6:16 AM, Gavin Bierman wrote: Hi Manoj, This is certainly something we can discuss

Re: case null and type pattern

2021-07-19 Thread Gavin Bierman
Hi Manoj, This is certainly something we can discuss for Preview 2, but…it is intentional for now. The `case null, T t` is really a special case of extending a type pattern to be null friendly. Remember that the pattern variable `t` is initialised with null if this case label applies. The

Re: case null and type pattern

2021-07-18 Thread Remi Forax
- Original Message - > From: "Manoj Palat" > To: "amber-spec-experts" > Sent: Jeudi 15 Juillet 2021 00:43:40 > Subject: case null and type pattern > Hi Gavin, All, HI Manoj, > > In > http://cr.openjdk.java.net/~gbierman/jep406/jep406

case null and type pattern

2021-07-14 Thread Manoj Palat
Hi Gavin, All, In http://cr.openjdk.java.net/~gbierman/jep406/jep406-20210608/specs/patterns-switch-jls.html#jls-14.30.1, Section 14.11, I see "If a switch label has a null case label element then if the switch label also has any pattern case element labels, they must be type patterns