Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlightingPatternsInSwitch/WhenExpressionIsFalse.java
Tagir Valeev 2350d69472 [java-highlighting] JavaCompilationErrorBundle.properties proofreading (DOC-34381)
GitOrigin-RevId: 05bdca159a63027ea0d1e3d767d4adb9b258f47e
2025-02-14 12:45:24 +00:00

11 lines
457 B
Java

public class Main {
void foo(Object obj) {
final boolean flag = false;
switch (obj) {
case String s when <error descr="Case label has a guard that is a constant expression with value 'false'">false</error> -> {}
case String s when s.length() < 0 -> {}
case String s when <error descr="Case label has a guard that is a constant expression with value 'false'">((flag || flag)) && 1 < 0</error> -> {}
default -> {}
}
}
}