java completion: fix double T[] suggestion in toArray((<caret>)casted)

GitOrigin-RevId: 8c56d0e78ae8f0d027ca428165753b5db2fda543
This commit is contained in:
Peter Gromov
2020-04-27 20:00:42 +00:00
committed by intellij-monorepo-bot
parent d81527a685
commit d2f33b5f06
3 changed files with 13 additions and 0 deletions
@@ -1074,6 +1074,9 @@ public class ExpectedTypesProvider {
if (params.length <= index) continue;
PsiParameter param = params[index];
PsiType paramType = getParameterType(param, substitutor);
if (method.hasTypeParameters() && PsiTypesUtil.mentionsTypeParameters(paramType, ContainerUtil.newHashSet(method.getTypeParameters()))) {
continue;
}
TailType tailType = getMethodArgumentTailType(argument, index, method, substitutor, params);
ExpectedTypeInfoImpl info = createInfoImpl(paramType, ExpectedTypeInfo.TYPE_OR_SUBTYPE, paramType,
tailType, method, getPropertyName(param));
@@ -0,0 +1,8 @@
public class SomeClass {
{
java.util.List<Unresolved> l;
Unresolved[] a = l.toArray((<caret>)expr);
}
}
@@ -298,4 +298,6 @@ public void testConvertToObjectStream() {
public void testNestedCollectorsCounting() { doTest(false); }
public void testFilterInaccessibleConstructors() { doAntiTest(); }
public void testCastInToArrayCallWithUnresolvedType() { doAntiTest(); }
}