diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 49dee947..c4d5c296 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -1806,7 +1806,8 @@ namespace CppSharp.Generators.CSharp Class retClass = null; hiddenParam.Type.Desugar().IsTagDecl(out retClass); - WriteLine("var {0} = new {1}.Internal();", GeneratedIdentifier("ret"), QualifiedIdentifier(retClass)); + WriteLine("var {0} = new {1}.Internal();", GeneratedIdentifier("ret"), + QualifiedIdentifier(retClass.OriginalClass ?? retClass)); } var names = new List(); diff --git a/tests/CSharpTemp/CSharpTemp.h b/tests/CSharpTemp/CSharpTemp.h index 8ed8de8d..529a9589 100644 --- a/tests/CSharpTemp/CSharpTemp.h +++ b/tests/CSharpTemp/CSharpTemp.h @@ -22,6 +22,7 @@ class DLL_API Qux { public: int farAwayFunc() const; + int array[3]; }; class DLL_API Bar : public Qux