Summary: template ctors crash compiler
           Product: D
           Version: 2.023
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

Compiler segfaults when processing the following template if it was mixed in a
struct. It doesn't if the mixin happened inside a class.
It complains that Templ.this(int) is not a ctor (and that, hence, you can't
forward to this(double) from there) before crashing.

template Templ () {
    this(int i) { this(0.0); }
    this(double d) { }

class C { mixin Templ; } // OK
struct S { mixin Templ; } // Crashes in Templ

void main() { }


Reply via email to