[Issue 12737] New: static constructor requires call of super constructor

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon May 12 08:43:05 PDT 2014


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

          Issue ID: 12737
           Summary: static constructor requires call of super constructor
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: rburners at gmail.com

class A {
    this(int a) {
    }
}

class B : A {
    static this() {
    }
}

void main() {
    auto n = new B();
}

fails to compile with: Error: class staticctor.B Cannot implicitly generate a
default ctor when base class staticctor.A is missing a default ctor

IMO that is wrong. A has no static ctor nor static members.

--


More information about the Digitalmars-d-bugs mailing list