From 319b9691d207e934f0b33ba388a40146a65a6f71 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Tue, 14 Oct 2014 15:38:13 +0300 Subject: [PATCH] Marked the __Instance property in interfaces as synthetised. Signed-off-by: Dimitar Dobrev --- src/AST/Function.cs | 3 ++- src/AST/Property.cs | 5 +++++ src/Generator/Passes/MultipleInheritancePass.cs | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/AST/Function.cs b/src/AST/Function.cs index f509a9ab..fc01d9b8 100644 --- a/src/AST/Function.cs +++ b/src/AST/Function.cs @@ -93,7 +93,8 @@ namespace CppSharp.AST None, ComplementOperator, AbstractImplCall, - DefaultValueOverload + DefaultValueOverload, + InterfaceInstance } public class Function : Declaration, ITypedDecl, IMangledDecl diff --git a/src/AST/Property.cs b/src/AST/Property.cs index a5524f3a..0b530cd2 100644 --- a/src/AST/Property.cs +++ b/src/AST/Property.cs @@ -115,6 +115,11 @@ namespace CppSharp.AST } } + public bool IsSynthetized + { + get { return GetMethod != null && GetMethod.IsSynthetized; } + } + public override T Visit(IDeclVisitor visitor) { return visitor.VisitProperty(this); diff --git a/src/Generator/Passes/MultipleInheritancePass.cs b/src/Generator/Passes/MultipleInheritancePass.cs index edfd4469..23bd1ee7 100644 --- a/src/Generator/Passes/MultipleInheritancePass.cs +++ b/src/Generator/Passes/MultipleInheritancePass.cs @@ -84,7 +84,11 @@ namespace CppSharp.Passes instance.Namespace = @interface; instance.Name = Helpers.InstanceIdentifier; instance.QualifiedType = new QualifiedType(new BuiltinType(PrimitiveType.IntPtr)); - instance.GetMethod = new Method { Namespace = @interface }; + instance.GetMethod = new Method + { + SynthKind = FunctionSynthKind.InterfaceInstance, + Namespace = @interface + }; @interface.Properties.Add(instance); }