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

--- Comment #12 from RazvanN <razvan.nitu1...@gmail.com> ---
(In reply to Jacob Carlborg from comment #6)
> I might not have really understood how mixins worked back when I reported
> this issue so it might not be an issue.
> 
> There is one problem with this though. As far as I know you cannot alias a
> constructor to bring the two constructors to the same overload set.

There is a workaround:

template C ()                                                                   
{
    this (int i)
    {
    }
}

class A
{
    mixin C f;
    this ()
    {
    }
    alias __ctor = f.__ctor;
}

void main ()
{
    auto a = new A(3);
}

It seems that the __ctor alias works only if the symbol is already defined.

--

Reply via email to