D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3431 - Automatic deduction of anonymous delegate signatures
Summary: Automatic deduction of anonymous delegate signatures
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-21 05:19 UTC by Pelle Månsson
Modified: 2015-06-09 01:28 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 Pelle Månsson 2009-10-21 05:19:54 UTC
Anonymous delegates cannot use automatic type deduction. For example:

int f(int delegate(int) g) {
    return g(13);
}
void main() {
    f((auto x) { return x+13; });
}

This fails to compile. Omitting the 'auto' also fails to compile.
Comment 1 yebblies 2012-02-20 07:29:08 UTC
This works now, due to the recent improvements in delegate literal inference and conversions. (dmd 2.058)