Test case: --- void foo(const int x) { int delegate(int t) bar = (int t){ return x; }; } ------ bug.d(3): Error: cannot implicitly convert expression (__dgliteral1) of type c onst(int) delegate(int t) to int delegate(int t) ---- // But this one works.... void foo(const int x) { int delegate(int t) bar = (int t){ return x+0; }; } I think the reason for this is that TypeDelegate::implicitConvTo() is not defined. It should allow implicit conversions of return value between type const(T), immutable(T), and type T, when T is a value type. Certainly for delegate literals.
*** This issue has been marked as a duplicate of issue 3180 ***