isAssignable (IDEA-97276)

This commit is contained in:
anna
2012-12-12 15:59:15 +01:00
parent f43fc05230
commit b9669b6add
3 changed files with 6 additions and 1 deletions
@@ -911,7 +911,7 @@ public class TypeConversionUtil {
PsiSubstitutor leftSubstitutor = leftResult.getSubstitutor();
if (!leftClass.getManager().areElementsEquivalent(leftClass, rightClass)) {
if (!allowUncheckedConversion && PsiUtil.isRawSubstitutor(leftClass, leftSubstitutor) && !rightClass.hasTypeParameters()) return false;
if (!allowUncheckedConversion && PsiUtil.isRawSubstitutor(leftClass, leftSubstitutor) && !rightClass.hasTypeParameters() && !(rightClass instanceof PsiTypeParameter)) return false;
rightSubstitutor = getSuperClassSubstitutor(leftClass, rightClass, rightSubstitutor);
rightClass = leftClass;
}
@@ -0,0 +1,4 @@
interface Interf<X extends Interf> {}
class SomeClass {
static <I extends Interf<? super I>> Class<I> someMethod(I i) { return null; }
}
@@ -204,6 +204,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testParameterizedParameterBound() throws Exception { doTest17Incompatibility(false); }
public void testInstanceClassInStaticContextAccess() throws Exception { doTest17Incompatibility(false); }
public void testFlattenIntersectionType() throws Exception { doTest17Incompatibility(false); }
public void testIDEA97276() throws Exception { doTest17Incompatibility(false); }
public void testJavaUtilCollections_NoVerify() throws Exception {
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));