diff --git a/src/Generator/Generators/CSharp/CSharpMarshal.cs b/src/Generator/Generators/CSharp/CSharpMarshal.cs index 58c1fccf..0389076b 100644 --- a/src/Generator/Generators/CSharp/CSharpMarshal.cs +++ b/src/Generator/Generators/CSharp/CSharpMarshal.cs @@ -501,8 +501,9 @@ namespace CppSharp.Generators.CSharp { if (Context.Parameter.Usage == ParameterUsage.Out) { + var qualifiedIdentifier = (@class.OriginalClass ?? @class).Visit(typePrinter); Context.SupportBefore.WriteLine("var {0} = new {1}.Internal();", - Generator.GeneratedIdentifier(Context.ArgName), @class.Name); + Generator.GeneratedIdentifier(Context.ArgName), qualifiedIdentifier); } else { diff --git a/tests/CSharp/CSharp.cpp b/tests/CSharp/CSharp.cpp index 682752e5..4e38191a 100644 --- a/tests/CSharp/CSharp.cpp +++ b/tests/CSharp/CSharp.cpp @@ -956,3 +956,7 @@ VirtualDtorAddedInDerived::~VirtualDtorAddedInDerived() } bool VirtualDtorAddedInDerived::dtorCalled = false; + +void NamespaceB::B::Function(CS_OUT NamespaceA::A &a) +{ +} diff --git a/tests/CSharp/CSharp.h b/tests/CSharp/CSharp.h index 299fc7e9..af04a23a 100644 --- a/tests/CSharp/CSharp.h +++ b/tests/CSharp/CSharp.h @@ -855,3 +855,19 @@ public: virtual ~VirtualDtorAddedInDerived(); static bool dtorCalled; }; + +namespace NamespaceA +{ + CS_VALUE_TYPE class DLL_API A + { + }; +} + +namespace NamespaceB +{ + class DLL_API B + { + public: + void Function(CS_OUT NamespaceA::A &a); + }; +} diff --git a/tests/Tests.h b/tests/Tests.h index 04c3c8a5..5ef86ba6 100644 --- a/tests/Tests.h +++ b/tests/Tests.h @@ -24,4 +24,4 @@ #define CS_OUT #define CS_IN_OUT -#define CS_VALUETYPE +#define CS_VALUE_TYPE