IDEA-124271

This commit is contained in:
Anna Kozlova
2014-04-23 20:10:19 +02:00
parent 209d176ea6
commit b8fb550a2e
3 changed files with 11 additions and 1 deletions
@@ -281,7 +281,7 @@ public class JavaGenericsUtil {
if (typeParameter == null) return null;
PsiClass owner = (PsiClass)typeParameter.getOwner();
if (owner == null) return null;
PsiSubstitutor superClassSubstitutor = TypeConversionUtil.getClassSubstitutor(owner, aClass, PsiSubstitutor.EMPTY);
PsiSubstitutor superClassSubstitutor = TypeConversionUtil.getClassSubstitutor(owner, aClass, substitutor);
if (superClassSubstitutor == null) return null;
PsiType itemType = superClassSubstitutor.substitute(typeParameter);
itemType = substitutor.substitute(itemType);
@@ -0,0 +1,9 @@
interface Container<T extends Content> extends Iterable<T> {}
interface Content {}
class Main {
public static void doSomething(Container container) {
for (<error descr="Incompatible types. Found: 'java.lang.Object', required: 'Content'">Content content : container</error>) {}
}
}
@@ -347,6 +347,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testIDEA123518() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
public void testIDEA64103() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
public void testIDEA123338() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
public void testIDEA124271() { 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()));