mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
assignment fix for super wildcards (IDEA-125031)
This commit is contained in:
@@ -991,7 +991,7 @@ public class TypeConversionUtil {
|
||||
return isAssignable(leftBound, typeRight, effectiveAllowUncheckedConversion && !containsWildcards(leftBound));
|
||||
}
|
||||
else { // isSuper
|
||||
return isAssignable(typeRight, leftBound, effectiveAllowUncheckedConversion && !containsWildcards(leftBound));
|
||||
return isAssignable(typeRight, leftBound, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import java.util.Set;
|
||||
|
||||
class Test {
|
||||
|
||||
public static void test(Set foo, Matcher<Iterable<String>> matcher) {
|
||||
assertThat<error descr="'assertThat(Test.Matcher<? super java.util.Set>, java.util.Set)' in 'Test' cannot be applied to '(Test.Matcher<java.lang.Iterable<java.lang.String>>, java.util.Set)'">(matcher, foo)</error>;
|
||||
|
||||
Matcher<Iterable<String>> b = null;
|
||||
<error descr="Incompatible types. Found: 'Test.Matcher<java.lang.Iterable<java.lang.String>>', required: 'Test.Matcher<? super java.util.Set>'">Matcher<? super Set> a = b;</error>
|
||||
}
|
||||
|
||||
public static <T> void assertThat(Matcher<? super T> matcher, T actual) {}
|
||||
|
||||
static class Matcher<K> {}
|
||||
}
|
||||
@@ -351,6 +351,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA124352() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
public void testIDEA124019() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
public void testIDEA123509() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
public void testIDEA125031() { doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false); }
|
||||
|
||||
public void testJavaUtilCollections_NoVerify() throws Exception {
|
||||
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
|
||||
|
||||
Reference in New Issue
Block a user