mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-02 10:14:57 +07:00
[java-highlighting] IDEA-357866 Spurious "Different case kinds used in the switch" error on incomplete code
- improve error message GitOrigin-RevId: 2a8da472e07dd10bdb0ae75e679b6056ab884b72
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6d95a69a3e
commit
cd14483af8
+2
-2
@@ -19,11 +19,11 @@ class EnhancedSwitchStatements {
|
||||
}
|
||||
switch (new Random().nextInt()) {
|
||||
case 0 -> throw new IllegalStateException("no args");
|
||||
<error descr="Different case kinds used in the switch">case 1:</error> break;
|
||||
<error descr="Different 'case' kinds used in 'switch'">case 1:</error> break;
|
||||
}
|
||||
switch (new Random().nextInt()) {
|
||||
case 0: throw new IllegalStateException("no args"); break;
|
||||
<error descr="Different case kinds used in the switch">case 1 -> { System.out.println("one"); }</error>
|
||||
<error descr="Different 'case' kinds used in 'switch'">case 1 -> { System.out.println("one"); }</error>
|
||||
}
|
||||
|
||||
{ <error descr="Case statement outside switch">case 11 -> System.out.println("hi there");</error> }
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ class SwitchExpressions {
|
||||
|
||||
System.out.println(switch (new Random().nextInt()) {
|
||||
case 0 -> throw new IllegalStateException("no args");
|
||||
<error descr="Different case kinds used in the switch">case 1:</error> yield "lone";
|
||||
<error descr="Different 'case' kinds used in 'switch'">case 1:</error> yield "lone";
|
||||
});
|
||||
|
||||
System.out.println(
|
||||
|
||||
Reference in New Issue
Block a user