mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
lambda: ensure deep nested lambdas get target types from top level inference (IDEA-157314)
This commit is contained in:
+24
@@ -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) {}
|
||||
}
|
||||
Reference in New Issue
Block a user