Pattern Matching for switch (Second Preview)
forax at univ-mlv.fr
forax at univ-mlv.fr
Fri Oct 8 16:51:46 UTC 2021
----- Original Message -----
> From: "Gavin Bierman" <gavin.bierman at oracle.com>
> To: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "jan lahoda" <jan.lahoda at oracle.com>, "amber-dev" <amber-dev at openjdk.java.net>
> Sent: Vendredi 8 Octobre 2021 15:07:06
> Subject: Re: Pattern Matching for switch (Second Preview)
>> On 22 Sep 2021, at 21:37, Remi Forax <forax at univ-mlv.fr> wrote:
>>
>> And i think we should also fix the following
>>
>> 5. add an partial order edge between a guarded pattern and a constant of a
>> subtypes of the type of the guarded pattern
>> This code currently compiles
>> switch(value) {
>> case Integer i && bar() -> {}
>> case 3 -> {}
>> case Integer i -> {}
>> }
>>
>> but i think it should be written
>> switch(value) {
>> case 3 -> {}
>> case Integer i && bar() -> {}
>> case Integer i -> {}
>> }
>>
>> so the code is easier to read.
>
>
> Agreed. I’ll make this change.
I'm glad to hear that,
thank you.
Rémi
More information about the amber-dev
mailing list