diff --git a/java/java-psi-api/src/com/intellij/psi/GenericsUtil.java b/java/java-psi-api/src/com/intellij/psi/GenericsUtil.java index 30f42dc98f22..2fd912939d7e 100644 --- a/java/java-psi-api/src/com/intellij/psi/GenericsUtil.java +++ b/java/java-psi-api/src/com/intellij/psi/GenericsUtil.java @@ -65,10 +65,8 @@ public class GenericsUtil { if (type1 instanceof PsiArrayType && type2 instanceof PsiArrayType) { final PsiType componentType = getLeastUpperBound(((PsiArrayType)type1).getComponentType(), - ((PsiArrayType)type2).getComponentType(), manager); - if (componentType != null) { - return componentType.createArrayType(); - } + ((PsiArrayType)type2).getComponentType(), compared, manager); + return componentType.createArrayType(); } if (type1 instanceof PsiIntersectionType) { Set newConjuncts = new LinkedHashSet(); diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57496.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57496.java new file mode 100644 index 000000000000..250b8fc109d3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA57496.java @@ -0,0 +1,11 @@ +interface I{} +interface A extends I{} +interface B extends I{} + +abstract class c{ + abstract T baz(T x, T y); + + void bar(A x, B y){ + baz(x, y); + } +} \ No newline at end of file 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 2e2c97728c44..4420851118df 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java @@ -169,6 +169,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase { public void testIDEA57493() throws Exception { doTest(false); } public void testIDEA57495() throws Exception { doTest(false); } public void testIDEA57494() throws Exception { doTest(false); } + public void testIDEA57496() throws Exception { doTest(false); } public void testInconvertibleTypes() throws Exception { doTest(false); } public void testIncompatibleReturnType() throws Exception { doTest(false); } public void testContinueInferenceAfterFirstRawResult() throws Exception { doTest(false); }