Bug 7290 – Heap allocation with scoped delegate literal

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2012-01-14T00:55:00Z
Last change time
2012-01-17T23:14:23Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2012-01-14T00:55:28Z
int foo(alias pred)(int val) { return pred(val); } int bar(int val) { scope pred = (int a) => a + val; //<- causes allocation return foo!(pred)(2); } void main() { bar(3) == 5 || assert(0); } ---- Related to resolved http://d.puremagic.com/issues/show_bug.cgi?id=7120
Comment #1 by bugzilla — 2012-01-17T23:14:23Z