Files
openide/java/java-tests/testData/inspection/duplicateBranchesInEnhancedSwitch/GuardedPatternMergeWithNull.java
Andrey Cherkasovandintellij-monorepo-bot 9ccc820db2 [java] Remove Java 17 Preview and Java 18 Preview language levels
IDEA-314047

GitOrigin-RevId: 8c24deb2dfb5361f08857d7933ab290476f4ce84
2023-06-19 17:37:05 +00:00

11 lines
230 B
Java

class C {
void foo(Object o) {
switch (o) {
case null -> bar("A");
case String s -> bar("B");
case Number n when n.intValue() == 42 -> bar("A");
default -> bar("C");
}
}
void bar(String s){}
}