Bug 5367 – Array of closures assign problem

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-12-24T00:40:00Z
Last change time
2012-02-01T20:37:29Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-12-24T00:40:43Z
This D2 program compiles with no errors: void delegate()[1] foo; void main() { int n; foo[0] = { n++; }; } But this one: void delegate()[1] foo; void main() { int n; foo[] = [{ n++; }]; } With DMD 2.051: test.d(4): Error: cannot implicitly convert expression ([delegate void() { n++; } ]) of type void delegate()[] to const(void delegate()[]) It looks like a front-end bug.
Comment #1 by yebblies — 2012-02-01T20:37:29Z
Probably fixed with the other delegate conversion bugs.