Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue 17130 - ambiguous implicit super call #6541

Merged
merged 1 commit into from Feb 15, 2017

Conversation

MartinNowak
Copy link
Member

  • need to pass class type to resolveFuncCall
  • also make implicit ctor shared for shared base ctor

- need to pass class type to resolveFuncCall
- also make implicit ctor shared for shared base ctor
@dlang-bot
Copy link
Contributor

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

auto fd = resolveFuncCall(loc, sc2, baseClass.ctor, null, null, null, 1);
auto fd = resolveFuncCall(loc, sc2, baseClass.ctor, null, type, null, 1);
if (!fd) // try shared base ctor instead
fd = resolveFuncCall(loc, sc2, baseClass.ctor, null, type.sharedOf, null, 1);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handling shared base ctor was added to not break existing code, even though it never worked to actually instantiate a class like Derived3 (b/c of the unshared implicit ctor).
Implicitly declaring overloaded ctors is out of scope for the bugfix and is a topic for Issue 9066 – Add constructor inheritance feature.

@UplinkCoder
Copy link
Member

@MartinNowak feel free to merge this yourself after it passes the unittests

@MartinNowak MartinNowak merged commit 69182da into dlang:master Feb 15, 2017
@MartinNowak MartinNowak deleted the fix17130 branch February 15, 2017 12:31
@PetarKirov
Copy link
Member

Thanks bringing this to completion, Martin! Last Sunday I debugged the code myself, but only got to
auto fd = resolveFuncCall(loc, sc2, baseClass.ctor, null, this.type, null, 1), before I ran out of time.

tramker pushed a commit to tramker/dmd that referenced this pull request Feb 8, 2018
fix Issue 17130 - [REG2.074] ambiguous implicit super call

cherry-picked-by: Martin Krejcirik <mk@krej.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants