On 5/2/16 6:00 PM, sigod wrote:
On Monday, 2 May 2016 at 10:15:04 UTC, Marc Schütz wrote:
On Monday, 2 May 2016 at 08:46:31 UTC, Ali Çehreli wrote:
[...]

Warning (better: disallowing altogether) about `=>` directly followed
by `{` should be enough to cover all cases. To express that you really
want a lambda returning a lambda, it can be rewritten either as:

    (x) => () { assert(x); }

or as:

    (x) => ({ assert(x); })

This check can be done purely by looking at the tokens. Should we
someday introduce tuples with `{}`, the check needs to be done after
the node starting with `{` has been parsed to distinguish between
delegate and tuple literals.

It's good idea. I myself stumbled into this before.

Agree.

-Steve

Reply via email to