mirror of https://github.com/mono/CppSharp.git
Browse Source
Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com> Conflicts: src/Generator/Driver.cs tests/Basic/Basic.cpp tests/Basic/Basic.hpull/307/head
5 changed files with 49 additions and 0 deletions
@ -0,0 +1,20 @@ |
|||||||
|
using CppSharp.AST; |
||||||
|
|
||||||
|
namespace CppSharp.Passes |
||||||
|
{ |
||||||
|
public class FixDefaultParamValuesOfOverridesPass : TranslationUnitPass |
||||||
|
{ |
||||||
|
public override bool VisitMethodDecl(Method method) |
||||||
|
{ |
||||||
|
if (method.IsOverride && !method.IsSynthetized) |
||||||
|
{ |
||||||
|
Method rootBaseMethod = ((Class) method.Namespace).GetRootBaseMethod(method); |
||||||
|
for (int i = 0; i < method.Parameters.Count; i++) |
||||||
|
{ |
||||||
|
method.Parameters[i].DefaultArgument = rootBaseMethod.Parameters[i].DefaultArgument; |
||||||
|
} |
||||||
|
} |
||||||
|
return base.VisitMethodDecl(method); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue