mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
detect type parameters cyclic inference
This commit is contained in:
+2
@@ -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];
|
||||
|
||||
+2
@@ -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);}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user