check bounds should ignore recursive substitution also when wildcard is captured

(cherry picked from commit bb08b50baa9e80cf8f99a87e1d8d040bb099e12c)
This commit is contained in:
anna
2013-11-25 16:47:51 +01:00
parent b8c1c38788
commit a9bc9bfb6d
2 changed files with 12 additions and 2 deletions
@@ -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);
}
@@ -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();
}