mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 08:51:02 +07:00
[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
This commit is contained in:
committed by
intellij-monorepo-bot
parent
13dec23fbc
commit
90db265d7a
@@ -0,0 +1,24 @@
|
||||
|
||||
class Main {
|
||||
public static abstract sealed class Sealed {
|
||||
public static final class SealedInheritor extends Sealed {}
|
||||
}
|
||||
|
||||
int f(Sealed o) {
|
||||
return switch(o) {
|
||||
case Sealed.SealedIn<caret>, null
|
||||
}
|
||||
}
|
||||
|
||||
int g(Sealed o) {
|
||||
return switch(o) {
|
||||
case null, Sealed.SealedIn<caret>
|
||||
}
|
||||
}
|
||||
|
||||
int h(Sealed o) {
|
||||
return switch(o) {
|
||||
case Sealed.SealedIn<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user