new inference, incorporation step: ignore type arguments in bounds, retrieve upper bounds of captured wildcards (IDEA-145244)

This commit is contained in:
Anna Kozlova
2015-11-11 17:35:32 +01:00
parent 3dcb251345
commit 59b55c3c00
3 changed files with 34 additions and 2 deletions
@@ -0,0 +1,20 @@
import java.util.*;
class Test {
public static void main(String[] args) {
Factory factory = new Factory();
final Class<? extends ClassB> bClass = null;
ClassB b = factory.create(bClass);
String str = factory.create<error descr="'create(java.lang.Class<T>)' in 'Test.Factory' cannot be applied to '(java.lang.Class<capture<? extends Test.ClassB>>)'">(bClass)</error>;
}
public static class Factory {
<T extends ClassA<I>, I extends List<String>> T create(Class<T> pClassA) {
return null;
}
}
interface ClassA<T extends List<String>> {}
interface ClassB extends ClassA<ArrayList<String>> {}
}