mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
illegal generic type for instanceof checks (IDEA-76997)
This commit is contained in:
+7
@@ -973,6 +973,13 @@ public class GenericsHighlightUtil {
|
||||
return HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, ref, JavaErrorMessages.message("generics.cannot.instanceof.type.parameters"));
|
||||
}
|
||||
|
||||
if (resolved instanceof PsiClass) {
|
||||
final PsiClass containingClass = ((PsiClass)resolved).getContainingClass();
|
||||
if (containingClass != null && ref.getQualifier() == null && containingClass.getTypeParameters().length > 0) {
|
||||
return HighlightInfo.createHighlightInfo(HighlightInfoType.ERROR, typeElement, JavaErrorMessages.message("illegal.generic.type.for.instanceof"));
|
||||
}
|
||||
}
|
||||
|
||||
final PsiType[] parameters = ref.getTypeParameters();
|
||||
for (PsiType parameterType : parameters) {
|
||||
if (parameterType != null &&
|
||||
|
||||
Reference in New Issue
Block a user