This may technically be an enhancement request, but it seems like a massive, glaring inconsistency for no good reason, so I consider it a bug. void main() { auto foo() { return 3; } } test.d(2): function declaration without return type. (Note that constructors are always named 'this') test.d(2): no identifier for declarator foo()
See bug 4401
This is parser problem, and there is no reason to reject it from dmd internally (e.g. The return type of function literal is almost inferred). *** This issue has been marked as a duplicate of issue 4401 ***