Files
openide/java/java-tests/testData/inspection/dataFlow/fixture/NoMatchExceptionSealedClassWithNullDefault.java
2026-02-11 14:51:17 +00:00

21 lines
377 B
Java

import org.jetbrains.annotations.Nullable;
class TestExample {
sealed interface II {
record AI() implements II {}
record BI() implements II {}
}
record RI(@Nullable II value) {}
@Nullable
private static II getII(RI ri) {
return switch (ri) {
case RI(II.BI bi) -> bi;
case RI(II.AI ai) -> ai;
case null, default -> null;
};
}
}