mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
accessibility: don't check supers during method/field type check
This commit is contained in:
+12
-10
@@ -1494,21 +1494,23 @@ public class GenericsHighlightUtil {
|
||||
return "Cannot access " + HighlightUtil.formatClass(aClass);
|
||||
}
|
||||
|
||||
if (checkParameters && superType instanceof PsiClassType) {
|
||||
for (PsiType psiType : ((PsiClassType)superType).getParameters()) {
|
||||
final String notAccessibleMessage = isSuperTypeAccessible(psiType, classes, checkParameters, resolveScope, factory);
|
||||
if (checkParameters) {
|
||||
if (superType instanceof PsiClassType) {
|
||||
for (PsiType psiType : ((PsiClassType)superType).getParameters()) {
|
||||
final String notAccessibleMessage = isSuperTypeAccessible(psiType, classes, true, resolveScope, factory);
|
||||
if (notAccessibleMessage != null) {
|
||||
return notAccessibleMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (PsiClassType type : aClass.getSuperTypes()) {
|
||||
final String notAccessibleMessage = isSuperTypeAccessible(type, classes, true, resolveScope, factory);
|
||||
if (notAccessibleMessage != null) {
|
||||
return notAccessibleMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (PsiClassType type : aClass.getSuperTypes()) {
|
||||
final String notAccessibleMessage = isSuperTypeAccessible(type, classes, checkParameters, resolveScope, factory);
|
||||
if (notAccessibleMessage != null) {
|
||||
return notAccessibleMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
+2
@@ -8,6 +8,8 @@ abstract class B {
|
||||
a.bar();
|
||||
|
||||
<error descr="Cannot access java.util.stream.Stream">a.myField</error>;
|
||||
|
||||
a.a();
|
||||
}
|
||||
|
||||
void f(java.util.List<? extends A> a) {
|
||||
|
||||
+2
@@ -8,4 +8,6 @@ public abstract class A implements List<Stream<String>> {
|
||||
public void bar() {}
|
||||
|
||||
public Stream<String> myField;
|
||||
|
||||
public A a() {}
|
||||
}
|
||||
Reference in New Issue
Block a user