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 q
> 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
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
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 pro