ignore type arguments on calls on raw types (IDEA-201219)

This commit is contained in:
Anna.Kozlova
2018-10-25 16:20:57 +02:00
parent f8c57bfa5a
commit 382cf50470
3 changed files with 13 additions and 0 deletions
@@ -341,6 +341,9 @@ public class MethodCandidateInfo extends CandidateInfo{
}
else {
PsiTypeParameter[] typeParams = method.getTypeParameters();
if (isRawSubstitution()) {
return JavaPsiFacade.getElementFactory(method.getProject()).createRawSubstitutor(mySubstitutor, typeParams);
}
for (int i = 0; i < myTypeArguments.length && i < typeParams.length; i++) {
incompleteSubstitutor = incompleteSubstitutor.put(typeParams[i], myTypeArguments[i]);
}
@@ -0,0 +1,9 @@
class RawTest<A> {
public <T> T foo() {
return null;
}
void bar(RawTest x){
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.lang.String'">String a = x.<String>foo();</error>
}
}
@@ -1041,5 +1041,6 @@ public class GenericsHighlighting8Test extends LightDaemonAnalyzerTestCase {
public void testBridgeMethodOverriding() { doTest(); }
public void testNestedWildcardsWithImplicitBounds() { doTest(); }
public void testCallOnRawWithExplicitTypeArguments() { doTest(); }
public void testNoCaptureConversionDuringDetectingSupertypesDeepInHierarchy() { doTest(); }
}