mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 17:20:54 +07:00
22 lines
454 B
Java
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";
|
|
}
|
|
});
|
|
}
|
|
}
|
|
} |