mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-203812 bad code green: switch expression does not have any case clauses
This commit is contained in:
+1
-1
@@ -1996,7 +1996,7 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
Set<String> missingConstants = new HashSet<>();
|
||||
boolean exhaustive = hasDefaultCase;
|
||||
if (!exhaustive) {
|
||||
if (selectorType instanceof PsiClassType) {
|
||||
if (!values.isEmpty() && selectorType instanceof PsiClassType) {
|
||||
PsiClass type = ((PsiClassType)selectorType).resolve();
|
||||
if (type != null && type.isEnum()) {
|
||||
for (PsiField field : type.getFields()) {
|
||||
|
||||
+6
@@ -58,4 +58,10 @@ class SwitchExpressions {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
enum Empty {}
|
||||
|
||||
boolean testEmpty(Empty e) {
|
||||
return switch (<error descr="'switch' expression does not have any case clauses">e</error>) {};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user