overload resolution: infer most specific agains formal param types substituted against site substitutor, including param bounds (IDEA-150773)

This commit is contained in:
Anna Kozlova
2016-01-25 18:43:52 +03:00
parent 7de02f09ff
commit a166bd1059
3 changed files with 67 additions and 5 deletions

View File

@@ -0,0 +1,24 @@
import java.util.List;
class TestIntelliJ<T, S extends List<T>> extends SubInterface<T, S> {
private <H extends SuperInterface<T, S>> H <warning descr="Private method 'test(H)' is never used">test</warning>(H t) {
System.out.println("SuperInterface" + t);
return t;
}
private <H extends SubInterface<T, S>> H test(H t) {
System.out.println("SubInterface" + t);
return t;
}
public static void main(String... args) {
TestIntelliJ<String, List<String>> testIntelliJ = new TestIntelliJ<>();
testIntelliJ.test(testIntelliJ);
}
}
interface SuperInterface<T, <warning descr="Type parameter 'S' is never used">S</warning> extends List<T>> {
}
abstract class SubInterface<T, S extends List<T>> implements SuperInterface<T, S> {
}