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: nob...@puremagic.com
        ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrov...@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: -------

Reply via email to