mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
check bounds should ignore recursive substitution also when wildcard is captured
(cherry picked from commit bb08b50baa9e80cf8f99a87e1d8d040bb099e12c)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
+6
-2
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user