Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/splitSwitchBranchWithSeveralCaseValues/afterConstantPatternGuard2.java
Tagir Valeev efbff7c99c [java-highlighting] Move guard expression to switch label
Part of IDEA-326939 Support multi-pattern switch labels that define no variables

GitOrigin-RevId: c236438af58e1c74a2bf12a5985b33cedadb9cbb
2023-08-18 08:18:06 +00:00

14 lines
357 B
Java

// "Split values of 'switch' branch" "true-preview"
class C {
void foo(Object o) {
switch (o) {
case Integer _ when o.hashCode() > 0:
System.out.println("hello");
break;
case String _ when o.hashCode() > 0:
System.out.println("hello");
break;
}
}
}