pattern matching bug

forax at univ-mlv.fr forax at univ-mlv.fr
Thu Oct 25 16:35:07 UTC 2018


----- Mail original -----
> De: "jan lahoda" <jan.lahoda at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>, "amber-dev" <amber-dev at openjdk.java.net>
> Envoyé: Jeudi 25 Octobre 2018 18:17:56
> Objet: Re: pattern matching bug

> Hi Remi,
> 
> Thanks for the report. I've filled this as:
> https://bugs.openjdk.java.net/browse/JDK-8212982
> 
> I believe this program should not compile (for switch expressions with
> rule cases, the case shouldn't complete normally).

yes, I agree.

> 
> Jan

Rémi

> 
> On 24.10.2018 12:08, Remi Forax wrote:
>> Using the amber-demo branch, this code prints bug *and* temp :)
>> Again this bug was found by Francois Green.
>>
>> public class SwitchBug {
>>
>>      static String hold(String item) -> switch(item) {
>>        case String s -> { System.out.println(s); }
>>        default -> "temp";
>>      }
>>
>>      public static void main(String[] args) {
>>          System.out.println(hold("bug"));
>>      }
>> }
>>
>> Rémi


More information about the amber-dev mailing list