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 d8cdf4758148..ef793fb5e721 100644 --- a/java/java-psi-api/src/com/intellij/psi/GenericsUtil.java +++ b/java/java-psi-api/src/com/intellij/psi/GenericsUtil.java @@ -279,6 +279,12 @@ public class GenericsUtil { if (acceptExtendsBound(extendsType, extendsBound)) continue nextTypeParam; } } + else if (substituted instanceof PsiCapturedWildcardType) { + final PsiType extendsBound = ((PsiCapturedWildcardType)substituted).getUpperBound(); + if (acceptExtendsBound(extendsType, extendsBound)) { + continue nextTypeParam; + } + } if (extendsType != null && !TypeConversionUtil.isAssignable(extendsType, substituted, allowUncheckedConversion)) { return Pair.create(typeParameter, extendsType); } diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java index a47977db6e89..964dca8b8e04 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GenericsHighlighting8Test.java @@ -77,7 +77,7 @@ public class GenericsHighlighting8Test extends LightDaemonAnalyzerTestCase { public void testInferenceWithUpperBoundPromotion() { doTest(); } - public void _testVariance() {//todo + public void testVariance() { doTest(); } public void testForeachTypes() { @@ -321,9 +321,13 @@ public class GenericsHighlighting8Test extends LightDaemonAnalyzerTestCase { public void testIDEA57486() { doTest(); } - public void testIDEA57492() { + + //compiles with java 6 + public void _testIDEA57492() { doTest(); } + + //compiles with java 6 public void _testIDEA57493() { doTest(); }