new inference: lift containing class type parameters for method references

(cherry picked from commit a341be1196484b6e4c33a7d10059d2bec5bdf955)
This commit is contained in:
anna
2013-11-24 17:24:05 +01:00
parent 912722b922
commit e493e0c778
3 changed files with 25 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
import java.util.List;
class Test {
interface Function<X, Y> {
Y m(X x);
}
interface Node<E> {
List<E> foo();
}
class Data<T, I> {
Data(I state, Function<I, List<T>> fun) { }
}
<O> Data<O, Node<O>> test(Node<O> collection) {
return new Data<>(collection, Node::foo);
}
}