6429 – Nested function error in reduce

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6429 - Nested function error in reduce
Summary: Nested function error in reduce
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
Reported: 2011年08月02日 07:27 UTC by Andrej Mitrovic
Modified: 2012年10月04日 14:18 UTC (History)
2 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2011年08月02日 07:27:56 UTC
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 2 Andrej Mitrovic 2011年08月04日 13:11:37 UTC
I think you accidentally a number and referenced 6429 instead of 6419. That pull doesn't fix this issue.
Comment 3 SomeDude 2012年04月27日 07:36:25 UTC
The first example also fails with 2.059 Win32... unless using the -inline flag !
Comment 4 Andrej Mitrovic 2012年10月04日 14:18:36 UTC
Seems fixed in 2.060.


AltStyle によって変換されたページ (->オリジナル) /