On 22.04.2016 13:46, Jeff Thompson wrote:
The function literal also works if I add "function int[]()": void main(string[] args) { immutable int[] array = function int[]() { int[] result = new int[10]; result[0] = 1; return result; }(); }
I take it you're on 2.070 or older then. 2.071 accepts it without `function`, which seems a bit inconsistent when I think about it.
Anyway, just `function` should be enough. But of course you can specify return type and empty parameter list if you want.