diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs index 56ef1463..e9289ba1 100644 --- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs @@ -173,7 +173,7 @@ namespace CppSharp.Generators.CSharp return isManagedContext ? "string" : "System.IntPtr"; PrimitiveType primitive; - if (pointee.IsPrimitiveType(out primitive)) + if (pointee.Desugar().IsPrimitiveType(out primitive)) return "System.IntPtr"; Class @class; @@ -242,6 +242,7 @@ namespace CppSharp.Generators.CSharp typeMap.Declaration = decl; typeMap.Type = template; Context.Type = template; + Context.CSharpKind = ContextKind; return new CSharpTypePrinterResult() { Type = GetCSharpSignature(typeMap),