http://d.puremagic.com/issues/show_bug.cgi?id=4665
Summary: map with no automatic closure Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 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 scope. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------