method reference: use site substitutor if nothing else was inferred

This commit is contained in:
Anna Kozlova
2014-03-31 18:47:53 +02:00
parent 990094f360
commit e28d3f5c95
3 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import java.util.List;
import java.util.function.Function;
class Base {
interface Seq<Eq> extends Iterable<Eq> {
static <E> Seq<E> of(Iterable<? extends E> source) {
return null;
}
<R> Seq<R> map(Function<? super Eq, ? extends R> mapper);
}
}
class Test3 extends Base {
void test4(Seq<List<String>> map) {
Seq<Seq<String>> mapped = map.map(Seq::of);
}
}