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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 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: -------