Files
Tagir Valeevandintellij-monorepo-bot 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

16 lines
453 B
Java

// "Merge with 'case String _'" "GENERIC_ERROR_OR_WARNING"
class C {
String foo(Object obj) {
switch (obj) {
case String _ when !((String)obj).isEmpty():
case Integer _ when ((Integer)obj) > 0:
System.out.println("x");
break;
case Double d when d > 0:
System.out.println("x");
break;
default:
}
return "";
}
}