Summary: map with no automatic closure
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-08-17 07:22:23 PDT ---
This D2 program seems correct:

import std.algorithm: map;
void main() {
    int n = 2;
    map!((double x){ return x * n; })([1.0, 2.0]);

But DMD 2.048 prints at run time:
object.Error: Access Violation

On IRC #D jA_cOp has commented that TDPL says that the compiler should
automatically choose delegate over function if it accesses its outer lexical

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to