calculate target type in the same way for statement/expressions lambdas

This commit is contained in:
Anna Kozlova
2014-05-01 15:33:13 +04:00
parent 896c488a2f
commit f2256cab48
4 changed files with 37 additions and 5 deletions
@@ -0,0 +1,17 @@
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
class SameCalls<ST> {
<B> List<B> bar(B a) {return null;}
<R> Optional<R> foo(Function<String, Optional<R>> computable) {return null;}
List<String> ff(SameCalls<String> sc){
return sc.foo((x) -> {
return Optional.of(bar(x));
}).get();
}
}