Browse Source

Simplify overrides of overrides of secondary bases

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1261/head
Dimitar Dobrev 6 years ago
parent
commit
9ea4289f15
  1. 7
      src/Generator/Generators/CSharp/CSharpSources.cs

7
src/Generator/Generators/CSharp/CSharpSources.cs

@ -1208,12 +1208,13 @@ namespace CppSharp.Generators.CSharp @@ -1208,12 +1208,13 @@ namespace CppSharp.Generators.CSharp
private void GenerateFunctionInProperty(Class @class, Method constituent,
Property property, QualifiedType type)
{
bool isInSecondaryBase = constituent.OriginalFunction != null &&
constituent.Namespace == @class;
if (constituent.IsVirtual && (!property.IsOverride ||
@class.GetBaseProperty(property).IsPure || constituent.OriginalFunction != null))
isInSecondaryBase || @class.GetBaseProperty(property).IsPure))
GenerateFunctionCall(GetVirtualCallDelegate(constituent),
constituent, type);
else if (property.IsOverride &&
constituent.OriginalFunction == null)
else if (property.IsOverride && !isInSecondaryBase)
WriteLine(property.GetMethod == constituent ?
"return base.{0};" : "base.{0} = value;", property.Name);
else

Loading…
Cancel
Save