do not create another capture when not necessary; capture should be the same when substitutor define such dependency (IDEA-57340; IDEA-5731)

This commit is contained in:
anna
2012-05-03 09:19:02 +02:00
parent cf8ab78b59
commit 7c3f532d9c
4 changed files with 51 additions and 1 deletions
@@ -0,0 +1,26 @@
class A<T, S> {
}
class B<L> {
A<L, L> foo() {
return null;
}
void bar(B<?> b, A<?, ?> foo1) {
baz(b.foo());
A<?, ?> foo = b.foo();
baz<error descr="'baz(A<K,K>)' in 'B' cannot be applied to '(A<capture<?>,capture<?>>)'">(foo)</error>;
baz<error descr="'baz(A<K,K>)' in 'B' cannot be applied to '(A<capture<?>,capture<?>>)'">(foo1)</error>;
}
<K> void baz(A<K, K> a) {
}
}
class C<T,S>{}
class D<T> extends C<T,T> {
void foo(D<?> x){ bar(x); }
<T> void bar(C<T,T> x){}
}
@@ -134,6 +134,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testIDEA72912() throws Exception {doTest(false);}
public void testIllegalGenericTypeInInstanceof() throws Exception {doTest(false);}
public void testIDEA57339() throws Exception {doTest(false);}
public void testIDEA57340() throws Exception {doTest(false);}
public void testJavaUtilCollections_NoVerify() throws Exception {
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));