[Issue 17257] New: Wrong recursive template destructor reflection

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Mar 14 07:54:52 PDT 2017


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

          Issue ID: 17257
           Summary: Wrong recursive template destructor reflection
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: japplegame at gmail.com

Discussion - https://forum.dlang.org/post/vkydqijqsdzrsuvzilha@forum.dlang.org

import std.string : format;

struct Bar(E) {
    void fun() {
        pragma(msg, format("fun:   Foo.__xdtor - %s", __traits(hasMember, E,
"__xdtor")));
    }
    ~this() {
        pragma(msg, format("~this:   Foo.__xdtor - %s", __traits(hasMember, E,
"__xdtor")));
    }
}

struct Foo {
    Bar!Foo foo;
    ~this() {}
}

Output:
~this: Foo.__xdtor - false
fun: Foo.__xdtor - true

Expected:
~this: Foo.__xdtor - true
fun: Foo.__xdtor - true

--


More information about the Digitalmars-d-bugs mailing list