Bug 6903 – Auto Return Doesn't Work With Nested Functions
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-11-07T08:38:00Z
Last change time
2011-11-07T09:54:21Z
Keywords
rejects-valid
Assigned to
nobody
Creator
dsimcha
Comments
Comment #0 by dsimcha — 2011-11-07T08:38:26Z
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()
Comment #1 by bearophile_hugs — 2011-11-07T09:34:33Z
See bug 4401
Comment #2 by k.hara.pg — 2011-11-07T09:54:21Z
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 ***