From b955068ad145b63e1326e9cb1d8cb1ab5f97ba18 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Sun, 13 Aug 2017 23:11:40 +0300 Subject: [PATCH] Fixed the type of a function to be its original return type. Signed-off-by: Dimitar Dobrev --- src/AST/Function.cs | 4 ++-- src/Generator/Generators/CSharp/CSharpSources.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AST/Function.cs b/src/AST/Function.cs index 7171f04a..2c9fb372 100644 --- a/src/AST/Function.cs +++ b/src/AST/Function.cs @@ -258,7 +258,7 @@ namespace CppSharp.AST return visitor.VisitFunctionDecl(this); } - public Type Type => ReturnType.Type; - public QualifiedType QualifiedType => ReturnType; + public Type Type => OriginalReturnType.Type; + public QualifiedType QualifiedType => OriginalReturnType; } } \ No newline at end of file diff --git a/src/Generator/Generators/CSharp/CSharpSources.cs b/src/Generator/Generators/CSharp/CSharpSources.cs index c6246b71..4bfb164d 100644 --- a/src/Generator/Generators/CSharp/CSharpSources.cs +++ b/src/Generator/Generators/CSharp/CSharpSources.cs @@ -937,7 +937,7 @@ namespace CppSharp.Generators.CSharp private void GenerateIndexerSetter(Function function) { Type type; - function.Type.IsPointerTo(out type); + function.OriginalReturnType.Type.IsPointerTo(out type); var @internal = TypePrinter.PrintNative(function.Namespace); var ctx = new CSharpMarshalContext(Context)