Bug 3431 – Automatic deduction of anonymous delegate signatures

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-10-21T05:19:00Z
Last change time
2015-06-09T01:28:30Z
Assigned to
nobody
Creator
pelle.mansson

Comments

Comment #0 by pelle.mansson — 2009-10-21T05:19:54Z
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 by yebblies — 2012-02-20T07:29:08Z
This works now, due to the recent improvements in delegate literal inference and conversions. (dmd 2.058)