This is correct; I agree this is “not quite where we want to be yet”, but the
path to get there is not obvious, which is why we haven’t proposed anything
more than we have.
At some level (though this isn’t the whole story), the “null pattern” is in the
same limbo as constant patterns. Consta
> On Apr 15, 2022, at 10:10 PM, Guy Steele wrote:
>
> That said, I am always (or at least now) a bit leery of language designers
> motivating a new language feature by pointing out that it would make a
> compiler easier to write. As I have learned the hard way on more than one
> language proje
Hi all,
i maybe wrong but it seems that the spec consider null as a kind of case
instead of as a kind of pattern, which disables the refactoring that should be
possible with the introduction of the record pattern.
Let suppose i have a sealed type with only one implementation declared like this
> From: "Guy Steele"
> To: "Brian Goetz"
> Cc: "amber-spec-experts"
> Sent: Saturday, April 16, 2022 4:10:06 AM
> Subject: Re: Evolving past reference type patterns
> Yes, this is a clear improvement to the example code.
> That said, I am always (or at least now) a bit leery of language design
> From: "Brian Goetz"
> To: "Remi Forax"
> Cc: "amber-spec-experts"
> Sent: Saturday, April 16, 2022 12:25:20 AM
> Subject: Re: [External] : Re: Evolving past reference type patterns
>>>
>>> Can you provides examples of such refactorings ?
> Refactoring
> int x = aShort;
> foo(x, x);
> to