lambda: ensure deep nested lambdas get target types from top level inference (IDEA-157314)

This commit is contained in:
Anna.Kozlova
2016-10-07 13:55:01 +02:00
parent b560ee5910
commit 98094c72de
4 changed files with 116 additions and 16 deletions
@@ -0,0 +1,24 @@
import java.util.Optional;
import java.util.function.UnaryOperator;
class Test {
private void example() {
update(x -> x.flatMap(y -> Optional.empty()));
update(x -> x.flatMap(y -> x.flatMap(z -> Optional.empty())));
update(x -> x.flatMap(y -> x.flatMap(z -> x.flatMap(w -> Optional.empty()))));
update(x -> {
return x.flatMap(y -> {
return x.flatMap(z -> {
return x.flatMap(w -> {
return Optional.empty();
});
});
});
});
}
void update(UnaryOperator<Optional<Integer>> u) {}
}