mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not accept deep bound promotion in type parameters withing bound check (IDEA-107654)
This commit is contained in:
+1
@@ -350,6 +350,7 @@ public class GenericsHighlightUtil {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (psiClass instanceof PsiTypeParameter && psiClass.getExtendsListTypes().length != 0) return false;
|
||||
}
|
||||
if (!type.isRaw()) return true;
|
||||
//allow unchecked conversions in method calls but not in type declaration
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class X<A extends X<A>> {
|
||||
static class Y<B extends Y> extends X<<error descr="Type parameter 'B' is not within its bound; should extend 'X<B>'">B</error>> {}
|
||||
}
|
||||
@@ -247,6 +247,10 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testCaptureTopLevelWildcardsForConditionalExpression() throws Exception { doTest5(false);}
|
||||
public void testGenericsOverrideMethodInRawInheritor() throws Exception { doTest5(false);}
|
||||
|
||||
public void testIDEA107654() throws Exception {
|
||||
doTest5(false);
|
||||
}
|
||||
|
||||
public void testIDEA27185(){ doTest(LanguageLevel.JDK_1_6, JavaSdkVersion.JDK_1_6, false); }
|
||||
public void testIDEA67571(){ doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
public void testTypeArgumentsOnRawType(){ doTest(LanguageLevel.JDK_1_6, JavaSdkVersion.JDK_1_6, false); }
|
||||
|
||||
Reference in New Issue
Block a user