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

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-01-30T16:47:00Z
Last change time
2017-03-22T12:21:29Z
Keywords
pull
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2017-01-30T16:47:40Z
cat > bug.d << CODE import core.sync.mutex : Mutex; class MyMutex : Mutex { } CODE dmd -c -o- bug ---- /home/dawg/Code/D/bug.d(3): Error: core.sync.mutex.Mutex.__ctor called with argument types () matches both: /home/dawg/dlang/dmd-master-2017-01-28/linux/bin64/../../src/druntime/import/core/sync/mutex.di(21): core.sync.mutex.Mutex.this() and: /home/dawg/dlang/dmd-master-2017-01-28/linux/bin64/../../src/druntime/import/core/sync/mutex.di(25): core.sync.mutex.Mutex.this() /home/dawg/Code/D/bug.d(3): Error: class bug.MyMutex cannot implicitly generate a default ctor when base class core.sync.mutex.Mutex is missing a default ctor ---- Introduced by https://github.com/dlang/druntime/issues/1728 or https://github.com/dlang/druntime/issues/1726. This is arguable a dmd bug, but it easily breaks any Mutex sub-class right now.
Comment #1 by code — 2017-01-30T17:04:55Z
Currently breaks vibe.d and a couple of projects on ci.dawg.eu.
Comment #2 by petar.p.kirov — 2017-01-31T16:24:06Z
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):
Comment #3 by code — 2017-02-01T14:29:16Z
I'll have a look at fixing the compiler implementation later today.
Comment #4 by code — 2017-02-03T16:57:29Z
Comment #5 by github-bugzilla — 2017-02-10T15:35:18Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/db81df0b6db19f5808e551a01730c15d341dc981 fix Issue 17130 - ambiguous implicit super call - need type of this to resolve base class ctor overloads https://github.com/dlang/dmd/commit/5262d78df2d2b4b3ee1fffc3393a5d57b535a481 Merge pull request #6513 from MartinNowak/fix17130 fix Issue 17130 - ambiguous implicit super call
Comment #6 by petar.p.kirov — 2017-02-12T15:04:53Z
Reopening because even though this was fixed: class MyMutex : Mutex { this() // OK after https://github.com/dlang/dmd/pull/6513 { } } the OP issue is still there: class MyMutex : Mutex { // NG } bug.d(3): Error: core.sync.mutex.Mutex.__ctor called with argument types () matches both: /home/zombinedev/code/repos/dlang/druntime/import/core/sync/mutex.di(21): core.sync.mutex.Mutex.this() and: /home/zombinedev/code/repos/dlang/druntime/import/core/sync/mutex.di(25): core.sync.mutex.Mutex.this() bug.d(3): Error: class mutex_attr.MyMutex cannot implicitly generate a default ctor when base class core.sync.mutex.Mutex is missing a default ctor
Comment #7 by code — 2017-02-14T11:38:45Z
Comment #8 by github-bugzilla — 2017-02-15T12:31:49Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/cfeb41ae8db207d708b48155760a52dba0c57791 fix Issue 17130 - ambiguous implicit super call - need to pass class type to resolveFuncCall - also make implicit ctor shared for shared base ctor https://github.com/dlang/dmd/commit/69182dac5d7e4ba0f32377715f24ccf910d2f333 Merge pull request #6541 from MartinNowak/fix17130 fix Issue 17130 - ambiguous implicit super call
Comment #9 by github-bugzilla — 2017-02-24T20:34:32Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/db81df0b6db19f5808e551a01730c15d341dc981 fix Issue 17130 - ambiguous implicit super call https://github.com/dlang/dmd/commit/5262d78df2d2b4b3ee1fffc3393a5d57b535a481 Merge pull request #6513 from MartinNowak/fix17130 https://github.com/dlang/dmd/commit/cfeb41ae8db207d708b48155760a52dba0c57791 fix Issue 17130 - ambiguous implicit super call https://github.com/dlang/dmd/commit/69182dac5d7e4ba0f32377715f24ccf910d2f333 Merge pull request #6541 from MartinNowak/fix17130
Comment #10 by github-bugzilla — 2017-03-22T12:21:29Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/db81df0b6db19f5808e551a01730c15d341dc981 fix Issue 17130 - ambiguous implicit super call https://github.com/dlang/dmd/commit/5262d78df2d2b4b3ee1fffc3393a5d57b535a481 Merge pull request #6513 from MartinNowak/fix17130 https://github.com/dlang/dmd/commit/cfeb41ae8db207d708b48155760a52dba0c57791 fix Issue 17130 - ambiguous implicit super call https://github.com/dlang/dmd/commit/69182dac5d7e4ba0f32377715f24ccf910d2f333 Merge pull request #6541 from MartinNowak/fix17130