diff --git a/src/AST/Function.cs b/src/AST/Function.cs index 1e5beb67..74bb8930 100644 --- a/src/AST/Function.cs +++ b/src/AST/Function.cs @@ -211,7 +211,7 @@ namespace CppSharp.AST public Type Type { get { return ReturnType.Type; } } public QualifiedType QualifiedType { get { return ReturnType; } } - public virtual QualifiedType GetFunctionType() + public FunctionType GetFunctionType() { var functionType = new FunctionType { @@ -222,12 +222,7 @@ namespace CppSharp.AST functionType.Parameters.AddRange(Parameters); ReplaceIndirectReturnParamWithRegular(functionType); - var pointerType = new PointerType - { - QualifiedPointee = new QualifiedType(functionType) - }; - - return new QualifiedType(pointerType); + return functionType; } static void ReplaceIndirectReturnParamWithRegular(FunctionType functionType) diff --git a/src/AST/Method.cs b/src/AST/Method.cs index 30c462f6..557ba730 100644 --- a/src/AST/Method.cs +++ b/src/AST/Method.cs @@ -151,23 +151,5 @@ namespace CppSharp.AST { return visitor.VisitMethodDecl(this); } - - public override QualifiedType GetFunctionType() - { - var qualifiedType = base.GetFunctionType(); - if (!IsStatic) - { - FunctionType functionType; - qualifiedType.Type.IsPointerTo(out functionType); - var instance = new Parameter - { - Name = "instance", - QualifiedType = new QualifiedType( - new BuiltinType(PrimitiveType.IntPtr)) - }; - functionType.Parameters.Insert(0, instance); - } - return qualifiedType; - } } } \ No newline at end of file