This is an instance of these bugs: https://issues.dlang.org/show_bug.cgi?id=5710 https://issues.dlang.org/show_bug.cgi?id=11946
But seeing that `map` works with a single lambda/local function, it should be possible to make it work with several ones too.
For the time being, a simple workaround is to make the local functions static:
void main() { static int square(int i) { return i*i; } static int twoTimes(int i) { return i+i; } import std.algorithm, std.stdio; auto arr = [1,2,3]; arr.map!(twoTimes, square).writeln; }