mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
[java] raise error for void type expressions in switch (IDEA-278454)
GitOrigin-RevId: e44afc9d82e2e8211171fa5eb1b5dff90acab375
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1cd8782c82
commit
0b768770f7
@@ -105,6 +105,11 @@ class MyTest {
|
||||
Runnable r = () -> <error descr="Target type for switch expression cannot be void">switch</error>(0) {
|
||||
default -> throw new IllegalArgumentException();
|
||||
};
|
||||
|
||||
var rv = switch (0) {
|
||||
case 0 -> 42;
|
||||
default -> <error descr="Expression type should not be 'void'">System.out.println(42)</error>;
|
||||
};
|
||||
}
|
||||
|
||||
static void test(boolean b, int i) {
|
||||
|
||||
Reference in New Issue
Block a user