mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
unqualified getClass() type fixed (IDEA-186043)
This commit is contained in:
+4
-1
@@ -208,7 +208,10 @@ public class PsiMethodCallExpressionImpl extends ExpressionPsiElement implements
|
||||
|
||||
boolean is15OrHigher = languageLevel.compareTo(LanguageLevel.JDK_1_5) >= 0;
|
||||
final PsiType getClassReturnType = PsiTypesUtil.patchMethodGetClassReturnType(call, methodExpression, method,
|
||||
type -> type != JavaElementType.CLASS, languageLevel);
|
||||
type -> type != JavaElementType.CLASS &&
|
||||
//enum can be created inside enum only, no need to mention it here
|
||||
type != JavaElementType.ANONYMOUS_CLASS
|
||||
, languageLevel);
|
||||
|
||||
if (getClassReturnType != null) {
|
||||
return getClassReturnType;
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
class B {
|
||||
}
|
||||
|
||||
B foo() {
|
||||
return new B() {
|
||||
void bar() {
|
||||
Class<? extends B> aClass1 = getClass();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
@@ -429,4 +429,5 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testClassInWrongPackage() { doTest6(false); }
|
||||
public void testRecursiveParamBoundsWhenSuperSubstitution() { doTest6(false); }
|
||||
public void testCaptureForBoundCheck() { doTest6(false); }
|
||||
public void testGetClassInAnonymous() { doTest6(false); }
|
||||
}
|
||||
Reference in New Issue
Block a user