我定义了以下方法.
class Some {
void doSome(Consumer<? super Other> consumer) {
}
<T extends Collection<? super Other>> T doSome(T collection) {
doSome(collection::add); // <<<<<<<<<<<<<<<<<<<
return collection;
}
}
现在,javac
人在抱怨.
Java:对getAttributes的引用不明确 这两种方法都使用(java.util.unction.Consumer<;?Super Other>;)在...和方法Dosome(T)在...一些匹配
为什么javac
不能区分Consumer
和Collection
?