Skip to content

Commit 9ea4289

Browse files
committed
Simplify overrides of overrides of secondary bases
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 65b17fc commit 9ea4289

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Generator/Generators/CSharp/CSharpSources.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,12 +1208,13 @@ private static Property GetActualProperty(Property property, Class c)
12081208
private void GenerateFunctionInProperty(Class @class, Method constituent,
12091209
Property property, QualifiedType type)
12101210
{
1211+
bool isInSecondaryBase = constituent.OriginalFunction != null &&
1212+
constituent.Namespace == @class;
12111213
if (constituent.IsVirtual && (!property.IsOverride ||
1212-
@class.GetBaseProperty(property).IsPure || constituent.OriginalFunction != null))
1214+
isInSecondaryBase || @class.GetBaseProperty(property).IsPure))
12131215
GenerateFunctionCall(GetVirtualCallDelegate(constituent),
12141216
constituent, type);
1215-
else if (property.IsOverride &&
1216-
constituent.OriginalFunction == null)
1217+
else if (property.IsOverride && !isInSecondaryBase)
12171218
WriteLine(property.GetMethod == constituent ?
12181219
"return base.{0};" : "base.{0} = value;", property.Name);
12191220
else

0 commit comments

Comments
 (0)