https://issues.dlang.org/show_bug.cgi?id=16093
--- Comment #2 from Max Samukha <[email protected]> --- (In reply to b2.temp from comment #1) > It's because f is local. When f is static (i.e like a free function) it works > void main() { int x = 1; void f() { x += 1; } bar!f(); // ok } 'f' above is local, and the compiled program works as expected. Can't see why making it a template should affect the semantics. Also, if the following didn't compile, the whole "pass functions by alias" business would go down the drain: void bar(alias f)() { f(1); } void main() { int y = 1; alias f = (x) { y += x; }; // local, equivalent to "void f(A)(A x) { y += x; }" bar!f(); // ok } --
