Bug 6429 – Nested function error in reduce

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-08-02T07:27:00Z
Last change time
2012-10-04T14:18:36Z
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2011-08-02T07:27:56Z
import std.algorithm; alias reduce!((a, b){ return 1; }) foo; void main() { foo([1, 2, 3]); } Error: delegate test.__dgliteral1!(int,int).__dgliteral1 is a nested function and cannot be accessed from reduce This will work however: import std.algorithm; void main() { alias reduce!((a, b){ return 1; }) foo; foo([1, 2, 3]); } I can't tell whether this is a bug or something subtle that I don't understand.
Comment #1 by bugzilla — 2011-08-04T12:58:48Z
Comment #2 by andrej.mitrovich — 2011-08-04T13:11:37Z
I think you accidentally a number and referenced 6429 instead of 6419. That pull doesn't fix this issue.
Comment #3 by lovelydear — 2012-04-27T07:36:25Z
The first example also fails with 2.059 Win32... unless using the -inline flag !
Comment #4 by andrej.mitrovich — 2012-10-04T14:18:36Z
Seems fixed in 2.060.