ambiguity: forgotten check on class type when check for type args (IDEA-67865)

This commit is contained in:
anna
2013-08-07 22:02:55 +02:00
parent 72028347f7
commit e777a6d77d
3 changed files with 29 additions and 5 deletions
@@ -0,0 +1,11 @@
import java.util.*;
abstract class A {
static <T> void foo(List<T> x) { }
static <T extends List<?>> void foo(Collection<T> x) { }
public static void main(String[] args){
List<List<String>> x = null;
foo<error descr="Ambiguous method call: both 'A.foo(List<List<String>>)' and 'A.foo(Collection<List<String>>)' match">(x)</error>;
foo<error descr="Ambiguous method call: both 'A.foo(List<Object>)' and 'A.foo(Collection<List<?>>)' match">(null)</error>;
}
}