detect type parameters cyclic inference

This commit is contained in:
anna
2013-05-07 17:19:58 +02:00
parent 3e8ef273d8
commit 2fe4b2c78a
3 changed files with 5 additions and 0 deletions
@@ -998,6 +998,8 @@ public class GenericsHighlightUtil {
for (int i = 0; i < typeParameters.length; i++) {
final PsiTypeParameter typeParameter1 = typeParameters[i];
final HighlightInfo cyclicInheritance = HighlightClassUtil.checkCyclicInheritance(typeParameter1);
if (cyclicInheritance != null) return cyclicInheritance;
String name1 = typeParameter1.getName();
for (int j = i + 1; j < typeParameters.length; j++) {
final PsiTypeParameter typeParameter2 = typeParameters[j];
@@ -0,0 +1,2 @@
class Test<<error descr="Cyclic inheritance involving 'T'"></error>T extends T> {}
class Test1<<error descr="Cyclic inheritance involving 'T'"></error>T extends S, S extends T> {}
@@ -237,6 +237,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testIDEA22005() throws Exception { doTest5(false);}
public void testIDEA57877() throws Exception { doTest5(false);}
public void testTypeParamsCyclicInference() throws Exception { doTest5(false);}
public void testCaptureTopLevelWildcardsForConditionalExpression() throws Exception { doTest5(false);}
public void testGenericsOverrideMethodInRawInheritor() throws Exception { doTest5(false);}