Skip to content

Commit

Permalink
fix Issue 17130 - ambiguous implicit super call
Browse files Browse the repository at this point in the history
- need type of this to resolve base class ctor overloads
  • Loading branch information
MartinNowak committed Feb 3, 2017
1 parent 31c7f4e commit db81df0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/func.d
Expand Up @@ -1763,7 +1763,7 @@ extern (C++) class FuncDeclaration : Declaration
sc2.callSuper = 0;

// Insert implicit super() at start of fbody
FuncDeclaration fd = resolveFuncCall(Loc(), sc2, cd.baseClass.ctor, null, null, null, 1);
FuncDeclaration fd = resolveFuncCall(Loc(), sc2, cd.baseClass.ctor, null, vthis.type, null, 1);
if (!fd)
{
error("no match for implicit super() call in constructor");
Expand Down
16 changes: 16 additions & 0 deletions test/compilable/test17130.d
@@ -0,0 +1,16 @@
class Base
{
this() shared
{}

this()
{}
}

class Derived : Base
{
this()
{
// implicit super();
}
}

0 comments on commit db81df0

Please sign in to comment.