pattern matching bug (original) (raw)

Remi Forax forax at univ-mlv.fr
Wed Oct 24 10:08:32 UTC 2018


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