mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
collect outer class type args for static cls and stop (IDEA-149008)
This commit is contained in:
@@ -142,7 +142,7 @@ public class ClsJavaCodeReferenceElementImpl extends ClsElementImpl implements P
|
||||
final String canonicalText,
|
||||
final Map<PsiTypeParameter, PsiType> substitutionMap) {
|
||||
final PsiClass containingClass = psiClass.getContainingClass();
|
||||
if (containingClass != null && !containingClass.hasModifierProperty(PsiModifier.STATIC)) {
|
||||
if (containingClass != null) {
|
||||
final String outerClassRef = getOuterClassRef(canonicalText);
|
||||
final String[] classParameters = PsiNameHelper.getClassParametersText(outerClassRef);
|
||||
final PsiType[] args = classParameters.length == 0 ? null : new ClsReferenceParameterListImpl(this, classParameters).getTypeArguments();
|
||||
@@ -152,7 +152,9 @@ public class ClsJavaCodeReferenceElementImpl extends ClsElementImpl implements P
|
||||
substitutionMap.put(typeParameters[i], args[i]);
|
||||
}
|
||||
}
|
||||
collectOuterClassTypeArgs(containingClass, outerClassRef, substitutionMap);
|
||||
if (!containingClass.hasModifierProperty(PsiModifier.STATIC)) {
|
||||
collectOuterClassTypeArgs(containingClass, outerClassRef, substitutionMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
import test.InnerClassTypeMultipleGeneric;
|
||||
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
InnerClassTypeMultipleGeneric.Outer<Character, Boolean>.Inner<Byte>
|
||||
byteInner = InnerClassTypeMultipleGeneric.staticType();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -35,6 +35,10 @@ public class ClsGenerics18HighlightingTest extends ClsGenericsHighlightingTest {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testOuterClassTypeArgs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCaptureContext() {
|
||||
String name = getTestName(false);
|
||||
addLibrary(name + ".jar", name + "-sources.jar");
|
||||
|
||||
Reference in New Issue
Block a user