Tools and libraries to glue C/C++ APIs to high-level languages
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

20 lines
660 B

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);
}
}
}