mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cls: compose raw substitutor if cls omits expected type arguments (IDEA-157254)
This commit is contained in:
+7
-2
@@ -172,8 +172,13 @@ public class ClsJavaCodeReferenceElementImpl extends ClsElementImpl implements P
|
||||
final PsiType[] args = classParameters.length == 0 ? null : new ClsReferenceParameterListImpl(this, classParameters).getTypeArguments();
|
||||
final PsiTypeParameter[] typeParameters = containingClass.getTypeParameters();
|
||||
for (int i = 0; i < typeParameters.length; i++) {
|
||||
if (args != null && i < args.length) {
|
||||
substitutionMap.put(typeParameters[i], args[i]);
|
||||
if (args != null) {
|
||||
if (i < args.length) {
|
||||
substitutionMap.put(typeParameters[i], args[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
substitutionMap.put(typeParameters[i], null);
|
||||
}
|
||||
}
|
||||
if (!containingClass.hasModifierProperty(PsiModifier.STATIC)) {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import p.AccountCalculator;
|
||||
import p.ObjectParameterDescriptor;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
class Test {
|
||||
public static void calc(AccountCalculator calculator,
|
||||
ObjectParameterDescriptor<String>.Holder holder) throws IOException{
|
||||
calculator.getMetrics(holder);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -35,6 +35,10 @@ public class ClsGenerics18HighlightingTest extends ClsGenericsHighlightingTest {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA157254() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testOuterClassTypeArgs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user