D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5045 - auto type inference for nest function
Summary: auto type inference for nest function
Status: RESOLVED DUPLICATE of issue 4401
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-11 18:13 UTC by bearophile_hugs
Modified: 2011-07-30 15:35 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2010-10-11 18:13:29 UTC
Maybe this is a duplicated error report, but I haven't found it.

Current dmd 2.049 doesn't support nested functions with "auto" return value:

void main() {
    auto foo() {
        return 1;
    }
}


DMD shows:
test.d(2): no identifier for declarator foo
test.d(2): semicolon expected, not '{'


But this is an useful feature to have because "auto" is becoming increasingly important as lazy Ranges often have a very complex type.
Comment 1 galaxylang 2010-10-16 22:56:02 UTC
i found it too,^-^
Comment 2 bearophile_hugs 2011-06-26 05:10:19 UTC
In DMD 2.053 the error messages are:

test.d(2): function declaration without return type. (Note that constructors are always named 'this')
test.d(2): no identifier for declarator foo()
Comment 3 David Nadlinger 2011-07-30 15:35:55 UTC

*** This issue has been marked as a duplicate of issue 4401 ***