Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/deleteSwitchLabel/beforeUnwrapExhaustiveSwitch2.java
Mikhail Pyltsin 830275db3c [java-highlighting] IDEA-324652 Unreachable branch quickfix produces incorrect code
GitOrigin-RevId: 3c00dae40f890c0a5bfda425f9c30d479f4d40b3
2023-07-17 11:27:28 +00:00

22 lines
454 B
Java

// "Remove unreachable branches" "false"
public class Switches {
sealed interface I2{}
record A() implements I2{}
record B() implements I2{}
void foo(I2 x) {
if (x instanceof A) {
System.out.println(switch (x) {
case A <caret>a -> {
System.out.println("something");
yield "1";
}
case B b -> {
System.out.println("something");
yield "2";
}
});
}
}
}