[Issue 17506] New: [REG2.075] @disable constructor requires members to be initialized

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jun 14 17:22:39 PDT 2017


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

          Issue ID: 17506
           Summary: [REG2.075] @disable constructor requires members to be
                    initialized
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: greensunny12 at gmail.com

cat > main.d << CODE
struct TreeMap
{
    this() @disable;
    this(TTree tree) { this.tree = tree; }
    TTree tree;
}

struct TTree
{
    this() @disable;
    this(int foo) {}
    ~this() {}
}

void main()
{
    auto k = TreeMap(TTree(1));
}
CODE

$ main.d
treemap.d(3): Error: field tree must be initialized in constructor

--


More information about the Digitalmars-d-bugs mailing list