diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java index 72ad0f26efa1..77a928abfb6b 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java @@ -358,8 +358,8 @@ public class GenericsHighlightUtil { if (inheritedSubstitutor != null) { final PsiTypeParameter[] typeParameters = superClass.getTypeParameters(); for (PsiTypeParameter typeParameter : typeParameters) { - PsiType type1 = GenericsUtil.eliminateWildcards(inheritedSubstitutor.substitute(typeParameter)); - PsiType type2 = GenericsUtil.eliminateWildcards(superTypeSubstitutor.substitute(typeParameter)); + PsiType type1 = inheritedSubstitutor.substitute(typeParameter); + PsiType type2 = superTypeSubstitutor.substitute(typeParameter); if (!Comparing.equal(type1, type2)) { String description = JavaErrorMessages.message("generics.cannot.be.inherited.with.different.type.arguments", diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousInheritance/pck/AmbiguousMethodCall.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousInheritance/pck/AmbiguousMethodCall.java index 580a30a72403..5eab22e56d86 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousInheritance/pck/AmbiguousMethodCall.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ambiguousInheritance/pck/AmbiguousMethodCall.java @@ -7,7 +7,7 @@ interface A interface B extends A { } -class C & B> +class C & B> { void foo(T x) { diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/InheritedWithDifferentArgsInTypeParams.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/InheritedWithDifferentArgsInTypeParams.java index 2adff2f8f495..180b75572c6e 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/InheritedWithDifferentArgsInTypeParams.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/InheritedWithDifferentArgsInTypeParams.java @@ -18,7 +18,7 @@ interface IA2 {} interface IB2 extends IA2 {} class A2 { - & IB2> void foo(){} + & IB2> void foo(){} } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/InheritedWithDifferentArgsInTypeParams1.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/InheritedWithDifferentArgsInTypeParams1.java new file mode 100644 index 000000000000..f7fda29752d4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/InheritedWithDifferentArgsInTypeParams1.java @@ -0,0 +1,10 @@ +import java.util.List; + +interface Base { +} + +interface Middle extends Base> { +} + +interface Child extends Middle, Base> { +} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/InheritedWithDifferentArgsInTypeParams.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/InheritedWithDifferentArgsInTypeParams.java index 2adff2f8f495..a1c0d83bc64a 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/InheritedWithDifferentArgsInTypeParams.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting8/InheritedWithDifferentArgsInTypeParams.java @@ -18,7 +18,7 @@ interface IA2 {} interface IB2 extends IA2 {} class A2 { - & IB2> void foo(){} + <T extends IA2 & IB2> void foo(){} } diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java index 9b8861a5a01c..529065446905 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java @@ -238,6 +238,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase { public void testIDEA106964() throws Exception { doTest5(false);} public void testIDEA107782() throws Exception { doTest5(false);} public void testInheritedWithDifferentArgsInTypeParams() throws Exception { doTest5(false);} + public void testInheritedWithDifferentArgsInTypeParams1() throws Exception { doTest5(false);} public void testIllegalForwardReferenceInTypeParameterDefinition() throws Exception { doTest5(false);} public void testIDEA57877() throws Exception { doTest5(false);}