mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
strip wildcards when prepare explicit generics types to qualify the method calls (IDEA-106741)
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@ public class AddTypeArgumentsFix extends MethodArgumentFix {
|
||||
PsiTypeParameter typeParameter = typeParameters[i];
|
||||
final PsiType substitution = helper.getSubstitutionForTypeParameter(typeParameter, returnType, toType, false, level);
|
||||
if (substitution == null || PsiType.NULL.equals(substitution)) return null;
|
||||
mappings[i] = substitution;
|
||||
mappings[i] = GenericsUtil.eliminateWildcards(substitution);
|
||||
}
|
||||
|
||||
final PsiElementFactory factory = JavaPsiFacade.getInstance(expression.getProject()).getElementFactory();
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
class X<A1, A2, R> { }
|
||||
|
||||
class D<R> {
|
||||
public <A1, A2> X<A1, A2, R> f() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class Z {
|
||||
public void f() {
|
||||
g(new D<Void>().<String, Integer>f());
|
||||
}
|
||||
|
||||
public void g(X<String, ? super Integer, Void> x) {
|
||||
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
class X<A1, A2, R> { }
|
||||
|
||||
class D<R> {
|
||||
public <A1, A2> X<A1, A2, R> f() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class Z {
|
||||
public void f() {
|
||||
g(new D<Void>().<caret>f());
|
||||
}
|
||||
|
||||
public void g(X<String, ? super Integer, Void> x) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user