D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7649 - Bad lambda inference in default function argument
Summary: Bad lambda inference in default function argument
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2012-03-05 06:15 UTC by Kenji Hara
Modified: 2012-03-05 12:14 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2012-03-05 06:15:33 UTC
Case code:
----
void main()
{
    void foo(int function(int) fp = x => 1)
    {
        assert(fp(1) == 1);
    }
    foo();
}

Output:
----
test.d(6): Error: undefined identifier __T1
test.d(6): Error: forward reference to __lambda2
Comment 2 github-bugzilla 2012-03-05 11:29:27 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/9939ff65daecba1dbc9b534166b5a06f3cf07c51
fix Issue 7649 - Bad lambda inference in default function argument