-
Bug
-
Resolution: Fixed
-
P2
-
12
-
b23
-
Verified
The below code leads to exception on execution.
interface TestIntf {
default int fun() {
return 1;
}
}
public class SwitchTest {
public static void main(String[] args) {
int x = 10;
var y = switch(x) {
case 0 -> new TestIntf(){};
default -> new TestIntf(){};
};
System.out.println(y.fun());
}
}
interface TestIntf {
default int fun() {
return 1;
}
}
public class SwitchTest {
public static void main(String[] args) {
int x = 10;
var y = switch(x) {
case 0 -> new TestIntf(){};
default -> new TestIntf(){};
};
System.out.println(y.fun());
}
}