Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMissingSealedClassSwitchBranches/afterSimpleNullableSealed.java
Mikhail Pyltsin cb37003541 [java-inspections] IDEA-357323 Propose case null during adding all cases
GitOrigin-RevId: 6d7ffccc28d64ed0f52db0235c41796d1d81284e
2024-08-09 11:00:42 +00:00

25 lines
408 B
Java

// "Create missing switch branches with null branch" "true-preview"
import org.jetbrains.annotations.Nullable;
class Test {
sealed interface SA permits R1, R2 {
}
record R1() implements SA {
}
record R2() implements SA {
}
public void test(@Nullable SA sa) {
switch (sa) {
case R1 r1 -> {
}
case R2 r2 -> {
}
case null -> {
}
}
}
}