inference: don't erase inference variables (IDEA-151750)

This commit is contained in:
Anna Kozlova
2016-02-16 15:57:18 +01:00
parent abd1b44e85
commit a530fe132f
4 changed files with 28 additions and 1 deletions
@@ -11,6 +11,6 @@ abstract class A1{
abstract <T> T baz(List<? super T> a);
void bar(List<?> x){
String o = baz<error descr="'baz(java.util.List<? super T>)' in 'A1' cannot be applied to '(java.util.List<capture<?>>)'">(x)</error>;
<error descr="Incompatible types. Found: 'T', required: 'java.lang.String'">String o = baz(x);</error>
}
}
@@ -0,0 +1,21 @@
interface E {}
interface F extends E {
ArrayFactory<F> ARRAY_FACTORY = null;
}
interface ArrayFactory<T> {
T[] create(int count);
}
interface Stub<K> {}
class M {
public F[] get(Stub s) {
return foo(s, F.ARRAY_FACTORY);
}
private <T extends E> T[] foo(Stub<T> stub, ArrayFactory<T> arrayFactory) {
return null;
}
}