Skip to content

Commit

Permalink
Fixed the implementation of secondary bases with overloads caused by …
Browse files Browse the repository at this point in the history
…default values.

Signed-off-by: Dimitar Dobrev <[email protected]>
  • Loading branch information
ddobrev committed Aug 10, 2015
1 parent b7187c8 commit de02c1a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Generator/Passes/MultipleInheritancePass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ private static void ImplementInterfaceMethods(Class @class, Class @interface)
foreach (var method in @interface.Methods)
{
if (@class.Methods.Any(m => m.OriginalName == method.OriginalName &&
m.Parameters.SequenceEqual(method.Parameters, parameterTypeComparer)))
m.Parameters.SequenceEqual(method.Parameters.Where(p => !p.Ignore),
parameterTypeComparer)))
continue;
var impl = new Method(method)
{
Expand Down
8 changes: 8 additions & 0 deletions tests/CSharpTemp/CSharpTemp.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ public void TestUncompilableCode()
new InheritanceBuffer().Dispose();
new HasProtectedVirtual().Dispose();
new Proprietor(5).Dispose();
using (var testOverrideFromSecondaryBase = new TestOverrideFromSecondaryBase())
{
testOverrideFromSecondaryBase.function();
var ok = false;
testOverrideFromSecondaryBase.function(ref ok);
var property = testOverrideFromSecondaryBase.property;
testOverrideFromSecondaryBase.VirtualMember();
}
using (var foo = new Foo())
{
var isNoParams = foo.IsNoParams;
Expand Down
6 changes: 5 additions & 1 deletion tests/CSharpTemp/CSharpTemp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ void SecondaryBase::setProperty(int value)
{
}

void SecondaryBase::function()
void SecondaryBase::function(bool* ok)
{
}

Expand All @@ -602,6 +602,10 @@ void SecondaryBase::setProtectedProperty(int value)
{
}

TestOverrideFromSecondaryBase::TestOverrideFromSecondaryBase()
{
}

void TestOverrideFromSecondaryBase::VirtualMember()
{
}
Expand Down
3 changes: 2 additions & 1 deletion tests/CSharpTemp/CSharpTemp.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ class DLL_API SecondaryBase
virtual void VirtualMember();
int property();
void setProperty(int value);
void function();
void function(bool* ok = 0);
protected:
void protectedFunction();
int protectedProperty();
Expand All @@ -583,6 +583,7 @@ class DLL_API SecondaryBase
class DLL_API TestOverrideFromSecondaryBase : public Foo, public SecondaryBase
{
public:
TestOverrideFromSecondaryBase();
void VirtualMember();
void setProperty(int value);
};
Expand Down

0 comments on commit de02c1a

Please sign in to comment.