Files
Tagir Valeevandintellij-monorepo-bot 623ee94480 [java-inspections] DuplicateBranchesInSwitchInspection improvements
1. Do not merge pattern with non-pattern branch
2. Colon labels with guards should not be merged into a single label
Leftovers after IDEA-326939

GitOrigin-RevId: 9fc54e643eda666771af2fc017dbef7d925dd76b
2023-09-19 01:24:53 +00:00

16 lines
438 B
Java

// "Merge with 'case Integer _'" "true"
class X {
void foo(Object o) {
switch (o) {
case Integer _, StringBuffer _ when o.hashCode()==1:
System.out.println("hello");
break;
case String _:
<caret>System.out.println("hello");
break;
default:
System.out.println("hello2");
break;
}
}
}