This is interesting, if you compile it with: dmd test.d It works. If you compile it with: dmd -inline test.d It doesn't compile and dmd returns: test.d(5): Error: function D main is a nested function and cannot be accessed from array
import std.algorithm: map;
import std.array: array;
void main() {
int c;
array(map!((x){return c;})([1]));
}
I think this is a compiler bug, right (because I think it must not compile in
both cases or compile in both)?
Bye,
bearophile
