[Issue 17055] this(...) hides this() of mixed in template

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Jan 21 01:42:32 PST 2017


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

--- Comment #2 from Ralph Alexander Bariz <ralph.bariz at gmail.com> ---
//////////////////////////////////////////////////////////
mixin template Foo()
{
    int x;

    this()
    {
        this.x=5;
    }
}

class Bar
{
    mixin Foo;

    this(int x)
    {
        this.x=x;
    }
}

void main()
{
    import std.stdio;

    auto a = new Bar();
    writeln(a.x);
}
//////////////////////////////////////////////////////////

leads to
/d994/f417.d(25): Error: constructor f417.Bar.this (int x) is not callable
using argument types ()

--


More information about the Digitalmars-d-bugs mailing list