[Issue 17456] New: [REG2.075a] spurious lifetime diagnostic on delegates
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue May 30 11:03:30 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17456
Issue ID: 17456
Summary: [REG2.075a] spurious lifetime diagnostic on delegates
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: b2.temp at gmx.com
repro:
===
struct Foo
{
private void delegate() dg;
void assign() @safe {dg = &sameThis;}
void sameThis(){}
}
===
yield: "address of variable this assigned to this with longer lifetime"
But the delegate is never escaped and the context pointer and the this have the
same lifetime.
--
More information about the Digitalmars-d-bugs
mailing list