mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-117780 Bad code is green: non-static class T cannot be referenced from a static context
This commit is contained in:
+1
-1
@@ -1079,7 +1079,7 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
|
||||
final PsiTypeParameterListOwner owner = ((PsiTypeParameter)resolved).getOwner();
|
||||
if (owner instanceof PsiClass) {
|
||||
final PsiClass outerClass = (PsiClass)owner;
|
||||
if (!InheritanceUtil.hasEnclosingInstanceInScope(outerClass, ref, true, false)) {
|
||||
if (!InheritanceUtil.hasEnclosingInstanceInScope(outerClass, ref, false, false)) {
|
||||
myHolder.add(HighlightClassUtil.reportIllegalEnclosingUsage(ref, aClass, (PsiClass)owner, ref));
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -10,4 +10,9 @@ class Test<T> {
|
||||
class B extends ArrayList<T> {
|
||||
void foo(T r){}
|
||||
}
|
||||
|
||||
static class C extends Test<<error descr="'Test.this' cannot be referenced from a static context">T</error>> {}
|
||||
static class D extends Test {
|
||||
<error descr="'Test.this' cannot be referenced from a static context">T</error> t;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user