mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-239116 Switch expression without any results is not highlighted as erroneous
GitOrigin-RevId: 66580d3aa4a95e1fdb32b1a3131544560c9c432a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5d753d02bd
commit
b3ba7b6783
+2
-2
@@ -28,13 +28,13 @@ class C {
|
||||
}
|
||||
|
||||
void defaultBranchAlwaysThrows(int n) {
|
||||
String s = switch (n) {
|
||||
String s = <error descr="Switch expression does not have any result expressions">switch</error> (n) {
|
||||
default: throw new RuntimeException();
|
||||
};
|
||||
}
|
||||
|
||||
void defaultRuleAlwaysThrows(int n) {
|
||||
String s = switch (n) {
|
||||
String s = <error descr="Switch expression does not have any result expressions">switch</error> (n) {
|
||||
default -> throw new RuntimeException();
|
||||
};
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
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();
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user