← Back to index
|
Original Bugzilla link
Bug 8999 – Closure not detected for reference paramters of templated functions
Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-12T01:21:00Z
Last change time
2015-02-23T06:45:05Z
Keywords
wrong-code
Assigned to
nobody
Creator
verylonglogin.reg
Blocks
2573
Comments
Comment #0
by verylonglogin.reg — 2012-11-12T01:21:58Z
In the following example closure isn't detected: --- import std.stdio; void copyDel()(out void delegate() dest, void delegate() src) { dest = src; } void g(out void delegate() del) { int i; void f() { writefln("&i: %X (should be in heap)", &i); } copyDel(del, &f); } void main() { int j; writefln("A heap address: %X", new int); writefln("A stack address: %X", &j); void delegate() del; g(del); del(); } --- Output: --- A heap address: A01E70 A stack address: 12FE64 &i: 12FE50 (should be in heap) <- not in heap ---
Comment #1
by verylonglogin.reg — 2012-11-12T01:25:49Z
*** Issue 6768 has been marked as a duplicate of this issue. ***
Comment #2
by k.hara.pg — 2015-02-23T06:45:05Z
Fixed in 2.063, because it's a dup of issue 9834. *** This issue has been marked as a duplicate of issue 9834 ***