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

2021-07-19 Thread Brian Goetz
Sure, but again, I think users would find that restriction even more annoying; the vast majority of guards in languages with guarded patterns use the bindings to refine the match.  I'm not sure users would thank us for moving the restriction in this way. A more interesting flavor of the same

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, but they will be hard > to > use, since users will likely want to

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