revert (IDEA-120153)

This commit is contained in:
Anna Kozlova
2014-02-03 19:35:39 +04:00
parent 0e875b2959
commit b268a7f59c
3 changed files with 29 additions and 1 deletions
@@ -713,7 +713,11 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
ProgressManager.checkCanceled();
LOG.assertTrue(typeParameter != null);
if (!substitutor.getSubstitutionMap().containsKey(typeParameter)) {
substitutor = substitutor.put(typeParameter, TypeConversionUtil.erasure(siteSubstitutor.substitute(typeParameter), substitutor));
PsiType type = siteSubstitutor.substitute(typeParameter);
if (type instanceof PsiClassType && ((PsiClassType)type).resolve() instanceof PsiTypeParameter) {
type = TypeConversionUtil.erasure(type, substitutor);
}
substitutor = substitutor.put(typeParameter, type);
}
}
return substitutor;
@@ -0,0 +1,23 @@
import java.util.Collection;
import java.util.List;
class Idea {
class Library<T> {
public void f(Base<T> x) {
}
public void f(Derived<T> x) {
}
}
class Wrapper<T> {
}
class Base<In> {
}
class Derived<In> extends Base<In> {
}
public void main(Derived<Wrapper<String>> x) {
new Library<Wrapper<String>>().f(x);
}
}
@@ -336,6 +336,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testIDEA118037() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
public void testIDEA119546() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
public void testIDEA118527() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
public void testIDEA120153() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
public void testJavaUtilCollections_NoVerify() throws Exception {
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));