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)