Files
openide/java/java-tests/testData/codeInsight/completion/normal/CompleteSealedLabelSwitch_after.java
Nikita Eshkeev 90db265d7a [java][switch completion] IDEA-278622 Fix completion variants in switch case label
Use the `inheritorsFilter` when the element that is being filtered is of the PsiClass type regardless if the selector class of a switch block is sealed or not. All the inheritors of the sealed class get added in JavaCompletionProcessor.

GitOrigin-RevId: 28e70b44444edad329f086a9dca0557baea03bec
2021-09-27 13:36:08 +00:00

24 lines
412 B
Java

class Main {
public static abstract sealed class Sealed {
public static final class SealedInheritor extends Sealed {}
}
int f(Sealed o) {
return switch(o) {
case Sealed.SealedInheritor, null
}
}
int g(Sealed o) {
return switch(o) {
case null, Sealed.SealedInheritor
}
}
int h(Sealed o) {
return switch(o) {
case Sealed.SealedInheritor
}
}
}