[External] : Re: Evolving past reference type patterns
Brian Goetz
brian.goetz at oracle.com
Fri Apr 15 22:27:25 UTC 2022
Also, the following would be an error, even though the two are naturally
dual:
record Foo(int x) { }
Foo f = new Foo(aShort);
if (f instanceof Foo(short x)) { ... } // would be an error without
`short x` applicable to int
On 4/15/2022 6:25 PM, Brian Goetz wrote:
>
>>
>> Can you provides examples of such refactorings ?
>>
>
> Refactoring
>
> int x = aShort;
> foo(x, x);
>
> to
>
> let int x = aShort
> in foo(x, x);
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20220415/31fb948a/attachment-0001.htm>
More information about the amber-spec-experts
mailing list