Question about latest binary build
Marcus Thiesen
marcus at thiesen.org
Thu Jul 19 12:37:57 PDT 2012
2012/7/19 Dan Smith <daniel.smith at oracle.com>:
> Runnable r = () -> list.add("hi");
>
> Seems convenient, but causes trouble for overload resolution. So for now, this is not allowed (pending further discussion). You would need to use a block instead:
>
> Runnable r = () -> { list.add("hi"); };
Please do not make me think about the return values of the method I
call when writing a Lambda.
For the sake of consistency I would always opt for one way to write a
lambda, even if it makes me write the block around the lambda body all
the time.
BTW, I only found that because examples I wrote for an older version
of the compiler stopped compiling. So these "relaxed rules" had been
implemented at some point in time.
Have fun,
Marcus
--
Marcus Thiesen :: www.thiesen.org :: @mthiesen :: 0173 / 28 01 82 4
More information about the lambda-dev
mailing list