www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20049] New: object.destroy doesn't propagate attributes

https://issues.dlang.org/show_bug.cgi?id=20049

          Issue ID: 20049
           Summary: object.destroy doesn't propagate attributes
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: ilyayaroshenko gmail.com

https://run.dlang.io/is/OHlf2c

import std.stdio;

static interface I { ref double bar()  safe pure nothrow  nogc; }
static abstract class D { int index; }
static class C : D, I
{
    double value;
    ref double bar()  safe pure nothrow  nogc { return value; }
    this(double d) { value = d; }
    ~this() nothrow {}
}

void main() nothrow
{
    auto c = new C(1);
    destroy(c);
}

--
Jul 13 2019