Files
Mikhail Pyltsinandintellij-monorepo-bot 7f404478c7 [java-inspections] IDEA-332919 Convert to old-style switch: produce incorrect code for guards
- preserve guards for patterns
- preserve comma-style for unnamed patterns

GitOrigin-RevId: c306280bded29ac3b6acb88b0ef6071bf50fefcb
2023-09-20 18:30:09 +00:00

10 lines
276 B
Java

// "Replace with old style 'switch' statement" "true-preview"
class UnnamedGuardedExpressions {
void foo3(Object o) {
switc<caret>h (o) {
case Integer _, String _ when o.hashCode() == 1 -> System.out.println(1);
default -> System.out.println(2);
}
}
}