RFR(s): 8152617 add missing wildcards to Optional or() and flatMap()
Stefan Zobel
spliterator at gmail.com
Fri Oct 7 20:02:33 UTC 2016
2016-10-07 21:42 GMT+02:00 Michael Nascimento <misterm at gmail.com>:
> Doesn't work, as Stuart has noted (s'marks, as far as I know your
> explanation is 100% correct). Nested generics == pain :-(
Hi Michael,
sorry for being obtrusive. What exactly doesn't work?
Stuart's example
Optional<Integer> oi = Optional.empty();
Function<Number, Optional<StringBuilder>> fm = n -> Optional.empty();
Optional<CharSequence> ocs = oi.flatMap(fm);
System.out.println(ocs.orElse("empty"));
work's for me (on 1.8.0_51). Sorry, I'm just trying to understand.
Kind regards,
Stefan
>
> Regards,
> Michael
>
More information about the core-libs-dev
mailing list