captured wildcards: refactor to extract same parts for extends/super wildcards, ensure upper bound is not lost for extends wildcard (IDEA-57292)

This commit is contained in:
Anna Kozlova
2015-05-21 10:00:23 +02:00
parent d31fb8b83f
commit fea58865be
7 changed files with 84 additions and 66 deletions
@@ -0,0 +1,24 @@
class C56 {
class A<T,S extends T> {}
class C {
void foo(A<?,?> x){
bar(x);
}
<T,S extends T> void bar(A<T,S> x){}
}
}
class C57 {
class B<T,S> {}
class A<T,S extends T> extends B<T,S> {}
class C {
void foo(A<?,?> x){
bar(x);
}
<T,S extends T> void bar(B<T,S> x){}
}
}
@@ -496,6 +496,10 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
doTest(LanguageLevel.JDK_1_8, JavaSdkVersion.JDK_1_8, true);
}
public void testPreserveCaptureWildcardsInUpperBounds() throws Exception {
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()));
assertNotNull(collectionsClass);