I am not sure, but perhaps all the following code should compile: void main() { void function(int x) f1; f1 = (x) {}; // OK void function(ref int x) f2; f2 = (ref int x) {}; // OK f2 = (ref x) {}; // OK f2 = (x) {}; // Error void function(out int x) f3; f3 = (out int x) {}; // OK f3 = (out x) {}; // OK f3 = (x) {}; // Error void delegate(int x) d1; d1 = (x) {}; // OK void delegate(ref int x) d2; d2 = (ref int x) {}; // OK d2 = (ref x) {}; // OK d2 = (x) {}; // Error void delegate(out int x) d3; d3 = (out int x) {}; // OK d3 = (out x) {}; // OK d3 = (x) {}; // Error } DMD 2.066alpha gives: test.d(7,10): Error: cannot implicitly convert expression (__lambda4) of type void function(int x) pure nothrow @nogc @safe to void function(ref int x) test.d(11,10): Error: cannot implicitly convert expression (__lambda7) of type void function(int x) pure nothrow @nogc @safe to void function(out int x) test.d(17,10): Error: cannot implicitly convert expression (__lambda11) of type void delegate(int x) pure nothrow @nogc @safe to void delegate(ref int x) test.d(21,10): Error: cannot implicitly convert expression (__lambda14) of type void delegate(int x) pure nothrow @nogc @safe to void delegate(out int x)
This is a duplicate of 9423, which contains more information, including a comment from Kenji as to why this is the case. *** This issue has been marked as a duplicate of issue 9423 ***