In DMD 2.058head the compiler accepts a function template as argument for the foo() function: void foo(int function(int x) g) {} void main() { foo((x) => 0); // OK } So I think it should accept an assignment too: void main() { int function(int x) f; f = (x) => 0; // Error } Currently it gives: test.d(3): Error: __lambda4 has no value
I've already post a pull to support inference on AssignExp. https://github.com/D-Programming-Language/dmd/pull/593
Fixed, among other problems: https://github.com/D-Programming-Language/dmd/commit/7fc5ebaf8776429fcaf38d1a55b6b25159ea9f18 See also bug 7176