Re: Fw: JEP 455: Non-enhanced switch statements

2023-10-29 Thread Brian Goetz
eed. *From:* amber-spec-experts on behalf of Maurizio Cimadamore *Sent:* 27 October 2023 16:37 *To:* Brian Goetz ; amber-spec-experts@openjdk.org *Subject:* Re: Fw: JEP 455: Non-enhanced switch statements No disagreement here. But

Re: Fw: JEP 455: Non-enhanced switch statements

2023-10-29 Thread Angelos Bimpoudis
not be altered indeed. From: amber-spec-experts on behalf of Maurizio Cimadamore Sent: 27 October 2023 16:37 To: Brian Goetz ; amber-spec-experts@openjdk.org Subject: Re: Fw: JEP 455: Non-enhanced switch statements No disagreement here. But I'd still poin

Re: Fw: JEP 455: Non-enhanced switch statements

2023-10-27 Thread Maurizio Cimadamore
No disagreement here. But I'd still point out that I'd rather see exhaustiveness being associated with the type being switched on, rather than on whether the switch body happens to use certain features or not. For sealed types we're lucky, because switching on them wasn't possible before - so

Re: Fw: JEP 455: Non-enhanced switch statements

2023-10-27 Thread Brian Goetz
Sure - but this logic is only applied to switch expression featuring enums AFAIK - switch statements with enums are non-exhaustive (and I think that will have to stay that way). Slight correction: switch statements on enum selectors *that don't use patterns or guards or case null* are non-e

Re: Fw: JEP 455: Non-enhanced switch statements

2023-10-27 Thread Maurizio Cimadamore
Sure - but this logic is only applied to switch expression featuring enums AFAIK - switch statements with enums are non-exhaustive (and I think that will have to stay that way). Maurizio On 27/10/2023 15:28, Brian Goetz wrote: Unfortunately enum is that one case where compatibility dictate

Re: Fw: JEP 455: Non-enhanced switch statements

2023-10-27 Thread Brian Goetz
Unfortunately enum is that one case where compatibility dictates that we can't be exhaustive, which is a little sad... but I think that's the best we can do? What we do for enums is do exhaustiveness checking based on the compile-time state of the world, and generate a synthetic default

Re: Fw: JEP 455: Non-enhanced switch statements

2023-10-27 Thread Maurizio Cimadamore
iformity in what the user will assume, thus I will fix the bug. What do others think? *From:* Yuriy Maslyanko *Sent:* 24 October 2023 21:57 *To:* Angelos Bimpoudis *Cc:* compiler-...@openjdk.org *Subject:* JEP 455: Non-enhanc

Re: JEP 455: Non-enhanced switch statements

2023-10-25 Thread Brian Goetz
m: *"Angelos Bimpoudis" *To: *"amber-spec-experts" *Cc: *"Yuriy Maslyanko" *Sent: *Wednesday, October 25, 2023 12:49:18 AM *Subject: *Fw: JEP 455: Non-enhanced switch statements Hello all! Hello Angelos, Yuriy pointed out a valid point. 1) Shou

Re: JEP 455: Non-enhanced switch statements

2023-10-25 Thread Remi Forax
> From: "Angelos Bimpoudis" > To: "amber-spec-experts" > Cc: "Yuriy Maslyanko" > Sent: Wednesday, October 25, 2023 12:49:18 AM > Subject: Fw: JEP 455: Non-enhanced switch statements > Hello all! Hello Angelos, > Yuriy pointed out a vali

Fw: JEP 455: Non-enhanced switch statements

2023-10-24 Thread Angelos Bimpoudis
favour of the 2) for the shake of symmetry and uniformity in what the user will assume, thus I will fix the bug. What do others think? From: Yuriy Maslyanko Sent: 24 October 2023 21:57 To: Angelos Bimpoudis Cc: compiler-...@openjdk.org Subject: JEP 455: Non