SAM conversion of inlined lambda expression
Neal Gafter
neal at gafter.com
Sat Aug 7 09:39:16 PDT 2010
On Aug 7, 2010, at 8:16 AM, Rémi Forax <forax at univ-mlv.fr> wrote:
> This is a bug, the prototype have a problem to infer types
> if there is a wilcard in the middle.
>
> by example, this doesn't compile:
> Function<String, ? extends String> b = #(x){ x + "b" };
Let's hope that this is just a bug, because wildcards must be used widely in higher-order APIs to get proper subtyping, even though the examples we've been discussing so far have simplified away this aspect. As long as APIs are expressed using SAMs and not function types, this is a level of complexity that programmers will simply have to learn when reading these APIs.
More information about the lambda-dev
mailing list