mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
intersection type validation fixed (IDEA-173900)
take type parameter bounds into account
This commit is contained in:
+2
-2
@@ -1984,8 +1984,8 @@ public class InferenceSession {
|
||||
final PsiSubstitutor sSubstitutor = TypeConversionUtil.getSuperClassSubstitutor(gClass, (PsiClassType)sBound);
|
||||
final PsiSubstitutor tSubstitutor = TypeConversionUtil.getSuperClassSubstitutor(gClass, (PsiClassType)tBound);
|
||||
for (PsiTypeParameter typeParameter : gClass.getTypeParameters()) {
|
||||
final PsiType sType = sSubstitutor.substitute(typeParameter);
|
||||
final PsiType tType = tSubstitutor.substitute(typeParameter);
|
||||
final PsiType sType = sSubstitutor.substituteWithBoundsPromotion(typeParameter);
|
||||
final PsiType tType = tSubstitutor.substituteWithBoundsPromotion(typeParameter);
|
||||
final Pair<PsiType, PsiType> typePair = Pair.create(sType, tType);
|
||||
if (!processor.process(typePair)) {
|
||||
return gClass;
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
|
||||
abstract class Bug {
|
||||
{
|
||||
D<?> _m = m();
|
||||
}
|
||||
|
||||
abstract <J extends C<? extends String>> J m();
|
||||
}
|
||||
|
||||
abstract class C<T extends String> { }
|
||||
abstract class D<T extends String> extends C<T> { }
|
||||
+1
@@ -115,6 +115,7 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
public void testPullUncheckedWarningNotionThroughNestedCalls() { doTest(); }
|
||||
public void testIDEA149774() { doTest(); }
|
||||
public void testDisjunctionTypes() { doTest(); }
|
||||
public void testValidIntersectionTypeWithCapturedBounds() { doTest(); }
|
||||
public void testPushErasedStateToArguments() { doTest(); }
|
||||
public void testStopAtStandaloneConditional() { doTest(); }
|
||||
public void testTransitiveInferenceVariableDependencies() { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user