[Issue 6429] New: Nested function error in reduce

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 2 07:27:58 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6429

           Summary: Nested function error in reduce
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2011-08-02 07:27:56 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list