ambiguous method call: prefer non raw types (IDEA-100314)

This commit is contained in:
Anna Kozlova
2013-02-04 11:22:13 +04:00
parent 8b28b06e00
commit c4be7cc14a
3 changed files with 20 additions and 0 deletions

View File

@@ -584,6 +584,12 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
if (map1.size() == 1 && map2.size() == 1) {
final PsiType t1 = map1.values().iterator().next();
final PsiType t2 = map2.values().iterator().next();
boolean raw1 = t1 instanceof PsiClassType && ((PsiClassType)t1).hasParameters();
boolean raw2 = t2 instanceof PsiClassType && ((PsiClassType)t2).hasParameters();
if (!raw1 && raw2) return Specifics.FIRST;
if (raw1 && !raw2) return Specifics.SECOND;
final Specifics substArraySpecifics = chooseHigherDimension(t1, t2);
if (substArraySpecifics != null) {
return substArraySpecifics;

View File

@@ -0,0 +1,13 @@
class Intellij {
public static <T> T getProperty(final String str, final Class<T> cls) {
return null;
}
public static <T> T getProperty(final String str, final T defaultValue) {
return null;
}
String[] ids = Intellij.getProperty(" ", String[].class);
}

View File

@@ -167,4 +167,5 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
public void testEnclosingInstance() throws Exception { doTest(false, false); }
public void testWrongArgsAndUnknownTypeParams() throws Exception { doTest(false, false); }
public void testAmbiguousMethodCallIDEA97983() throws Exception { doTest(false, false); }
public void testAmbiguousMethodCallIDEA100314() throws Exception { doTest(false, false); }
}