mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
intersection rules: flatten unbounded wildcard with everything (IDEA-132431)
This commit is contained in:
@@ -78,8 +78,8 @@ public class PsiIntersectionType extends PsiType.Stub {
|
||||
for (PsiType existing : array) {
|
||||
if (type != existing) {
|
||||
final boolean allowUncheckedConversion = type instanceof PsiClassType && ((PsiClassType)type).isRaw();
|
||||
if (TypeConversionUtil.isAssignable(GenericsUtil.eliminateWildcards(type),
|
||||
GenericsUtil.eliminateWildcards(existing), allowUncheckedConversion)) {
|
||||
if (TypeConversionUtil.isAssignable(type, existing, allowUncheckedConversion) ||
|
||||
TypeConversionUtil.isAssignable(GenericsUtil.eliminateWildcards(type), GenericsUtil.eliminateWildcards(existing), allowUncheckedConversion)) {
|
||||
iterator.remove();
|
||||
break;
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
|
||||
interface A<T> {
|
||||
void method();
|
||||
}
|
||||
|
||||
interface B<T extends A<?>> {
|
||||
void method(T arg);
|
||||
}
|
||||
|
||||
interface C {
|
||||
void method(B<? extends A<String>> arg);
|
||||
}
|
||||
|
||||
class Test {
|
||||
public static void test(C c) {
|
||||
c.method(arg -> arg.method( ));
|
||||
}
|
||||
}
|
||||
+4
@@ -40,6 +40,10 @@ public class FunctionalTypeWildcardParameterizationTest extends LightDaemonAnaly
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNonWildcardParameterizationForNonBoundWildcardBound() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable());
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false);
|
||||
|
||||
Reference in New Issue
Block a user