www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17456] New: [REG2.075a] spurious lifetime diagnostic on


          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 puremagic.com
          Reporter: b2.temp gmx.com


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.

May 30 2017