mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-03 11:47:50 +07:00
25 lines
606 B
Java
25 lines
606 B
Java
class Test {
|
|
void test() {
|
|
int i = <error descr="Switch expression does not have any result expressions">switch</error>(0) {
|
|
default -> throw new NullPointerException();
|
|
};
|
|
}
|
|
|
|
void test2() {
|
|
int i = <error descr="Switch expression does not have any result expressions">switch</error>(0) {
|
|
case 0 -> {while(true);}
|
|
case 1 -> {
|
|
throw new RuntimeException();
|
|
}
|
|
default -> throw new NullPointerException();
|
|
};
|
|
|
|
}
|
|
|
|
void positive() {
|
|
int i = switch(0) {
|
|
case 4 -> 2;
|
|
default -> throw new NullPointerException();
|
|
};
|
|
}
|
|
} |