IDEA-106964

This commit is contained in:
anna
2013-05-10 17:17:58 +02:00
parent b63077d97d
commit ea136f42f7
3 changed files with 18 additions and 9 deletions
@@ -599,15 +599,11 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
if (!raw1 && raw2) return Specifics.FIRST;
if (raw1 && !raw2) return Specifics.SECOND;
final Specifics substArraySpecifics = chooseHigherDimension(t1, t2);
if (substArraySpecifics != null) {
return substArraySpecifics;
}
else {
final PsiTypeParameter p1 = map1.keySet().iterator().next();
final PsiTypeParameter p2 = map2.keySet().iterator().next();
return checkTypeParams(method1, method2, classSubstitutor1, classSubstitutor2, type1, type2, p1, p2);
}
final PsiTypeParameter p1 = map1.keySet().iterator().next();
final PsiTypeParameter p2 = map2.keySet().iterator().next();
final Specifics specifics = checkTypeParams(method1, method2, classSubstitutor1, classSubstitutor2, type1, type2, p1, p2);
if (specifics != null) return specifics;
return chooseHigherDimension(t1, t2);
}
return null;
}
@@ -0,0 +1,12 @@
import java.io.Serializable;
public abstract class Test {
abstract <T> T test(Class<T> cls);
abstract <T> T test(Serializable type);
private void call(){
<error descr="Incompatible types. Found: 'java.lang.String[]', required: 'java.lang.String'">String s = test(String[].class);</error>
}
}
@@ -236,6 +236,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testIDEA20244() throws Exception { doTest5(false);}
public void testIDEA22005() throws Exception { doTest5(false);}
public void testIDEA57259() throws Exception { doTest5(false);}
public void testIDEA106964() throws Exception { doTest5(false);}
public void testInheritedWithDifferentArgsInTypeParams() throws Exception { doTest5(false);}
public void testIllegalForwardReferenceInTypeParameterDefinition() throws Exception { doTest5(false);}