mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
non wildcard parameterization: workaround problems caused by different parameterizations of the same class during glb algorithm (IDEA-132690)
This commit is contained in:
+1
-1
@@ -185,7 +185,7 @@ public class FunctionalInterfaceParameterizationUtil {
|
||||
newParameters[i] = bound != null ? bound : PsiType.getJavaLangObject(psiClass.getManager(), psiClassType.getResolveScope());
|
||||
for (PsiClassType paramBound : typeParameters[i].getExtendsListTypes()) {
|
||||
if (!PsiPolyExpressionUtil.mentionsTypeParameters(paramBound, typeParametersSet)) {
|
||||
newParameters[i] = GenericsUtil.getGreatestLowerBound(paramBound, newParameters[i]);
|
||||
newParameters[i] = GenericsUtil.getGreatestLowerBound(newParameters[i], paramBound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
interface A<T> {
|
||||
void method(B<? extends A<? super T>> arg);
|
||||
}
|
||||
|
||||
interface B<T extends A<?>> {
|
||||
void method();
|
||||
}
|
||||
|
||||
class Test {
|
||||
public static void test(A<?> a) {
|
||||
a.method(() -> {});
|
||||
}
|
||||
}
|
||||
+5
@@ -207,6 +207,11 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
//JDK-8043374
|
||||
public void testIntersectionTypeOfDifferentParameterizationOfTheSameClassInNonWildcardParameterization() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user