[Issue 19729] New: Constructor overloads coming from mixin are not resolved

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 10 23:23:41 UTC 2019


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

          Issue ID: 19729
           Summary: Constructor overloads coming from mixin are not
                    resolved
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com

While this work:

---
mixin template Templ(T) {
    void foo(T) {}
}

class C {
    mixin Templ!int;
    mixin Templ!string;
}

void main() {
    auto c = new C;
    c.foo("should work");
}  
---

This does not:

---
mixin template Templ(T) {
    this(T) {}
}

class C {
    mixin Templ!int;
    mixin Templ!string;
}

void main() {
    auto c = new C("should work");
}
--- 

And fails with a bad error message:  

> Error: overloadset `bn.C.__ctor` is aliased to a function

--


More information about the Digitalmars-d-bugs mailing list