Probably a bug

Tesla Zhang ice1000kotlin at foxmail.com
Thu Nov 18 04:19:38 UTC 2021


Hi all,

My friend Kiva have discovered an ICE of javac 17, here's the reproduction:


```
class Scratch {
  public static void main(String[] args) {
    switch (null) {
      case null -> System.out.println("114");
      default -> System.out.println("514");
    }
  }
}
```


FYI the following code compiles:


```
class Scratch {
  public static void main(String[] args) {
    var x = (Object) null;
    switch (x) {
      case null -> System.out.println("1919");
      default -> System.out.println("810");
    }
  }
}
```



I have no idea how to file a bug to openjdk, so I'm just posting it here.


Best regards,
Tesla


More information about the amber-dev mailing list