[Issue 17130] [Reg 2.074] ambiguous implicit super call when inheriting core.sync.mutex.Mutex

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jan 31 08:24:06 PST 2017


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

ZombineDev <petar.p.kirov at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |petar.p.kirov at gmail.com

--- Comment #2 from ZombineDev <petar.p.kirov at gmail.com> ---
This indeed looks like a compiler bug. If the base class has multiple default
constructors, the compiler should synthesize multiple default constructors in
the derived class. I.e. the base class and the derived class should have
equivalent default constructor overload sets.

BTW, the code in question can be easily be worked around like this:
class MyMutex : Mutex
{
    this()
    {
        super();
    }
}

Though the following did not work:
class MyMutex : Mutex
{
    this()
    {
    }
}

Error: core.sync.mutex.Mutex.__ctor called with argument types () matches both:
druntime/import/core/sync/mutex.di(21):     core.sync.mutex.Mutex.this()
and:
druntime/import/core/sync/mutex.di(25):     core.sync.mutex.Mutex.this()
bug.d(5):

--


More information about the Digitalmars-d-bugs mailing list