On Saturday, 22 October 2016 at 17:11:26 UTC, ag0aep6g wrote:
How is it guaranteed that `a` doesn't have side effects? May be a function call, since empty parentheses can be omitted in calls.

I missed that case. (Insert grumble about non-UFCS parenthesis omission being allowed).

The lambda itself is a value, no?

----
int a() { import std.stdio; writeln("a"); return 1; }

void main()
{
    int delegate(int) dg = (a, b => a + b);
}

OK. Though AIUI from 2.072 a() must return void for the comma expression to compile (then a+b wouldn't compile either).

Reply via email to