Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlightingPatternsInSwitch/ReachabilityEnhancedPrimitives.java
T
Mikhail Pyltsin 93b8460c43 [java] IDEA-385079 False positive "Unresolved reference" on method reference within lambda when used in switch expression
- change control flow for switch

GitOrigin-RevId: e291cb9393e764dd38021311c56909ecb88bc4f8
2026-01-30 10:08:10 +00:00

36 lines
913 B
Java

class AAA{
void testBoolean(boolean a) {
switch (a) {
case true:
throw new IllegalArgumentException();
case false:
throw new IllegalArgumentException();
}
<error descr="Unreachable statement">System.out.println();</error>
}
void testBoolean2(Boolean a) {
switch (a) {
case true:
throw new IllegalArgumentException();
case null:
throw new IllegalArgumentException();
default:
throw new IllegalStateException("Unexpected value: " + a);
}
<error descr="Unreachable statement">System.out.println();</error>
}
void testFloat(float a) {
switch (a) {
case 1f:
throw new IllegalArgumentException();
case Number v:
throw new IllegalStateException("Unexpected value: " + a);
}
<error descr="Unreachable statement">System.out.println();</error>
}
static void main() {
}
}