moreSpecific simplification, include complete check for inferred types in MethodCandidateInfo.isApplicable

This commit is contained in:
Anna Kozlova
2013-08-15 13:49:47 +04:00
parent 3a958ef8da
commit 47220fd160
9 changed files with 201 additions and 230 deletions
@@ -12,6 +12,6 @@ class B
{
public static void main(String[] args) {
A a = null;
a.foo<error descr="Ambiguous method call: both 'A.foo(Collection<?>)' and 'A.foo(List<?>)' match">(null)</error>;
a.foo<error descr="Ambiguous method call: both 'A.foo(List<?>)' and 'A.foo(List<?>)' match">(null)</error>;
}
}
@@ -0,0 +1,26 @@
package pck;
import java.util.List;
import static pck.C.foo;
import static pck.C.foo1;
import static pck.D.foo;
import static pck.D.foo1;
class C {
static <T> void foo(List<T> x) { }
static <T extends List> void foo1(List<T> x) { }
}
class D {
static <T extends List<S>, S> String foo(List<T> x) { return null; }
static <T extends List<?>, S> String foo1(List<T> x) { return null; }
}
public class Main {
public static void main(String[] args){
List<List<String>> x = null;
foo(x).toCharArray();
foo1(x).toCharArray();
}
}