Browse Source

Fixed code generation for using template types.

Thanks to @zillemarco for coming up with the test case.
pull/982/head
Joao Matos 8 years ago
parent
commit
bea0653268
  1. 4
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs
  2. 10
      tests/Common/Common.h

4
src/Generator/Generators/CSharp/CSharpTypePrinter.cs

@ -355,6 +355,10 @@ namespace CppSharp.Generators.CSharp @@ -355,6 +355,10 @@ namespace CppSharp.Generators.CSharp
template.Arguments.All(IsValid))
return $@"{VisitDeclaration(decl)}<{string.Join(", ",
template.Arguments.Select(VisitTemplateArgument))}>";
if (ContextKind == TypePrinterContextKind.Native)
return template.Desugared.Visit(this);
return decl.Visit(this);
}

10
tests/Common/Common.h

@ -1402,3 +1402,13 @@ union @@ -1402,3 +1402,13 @@ union
} Share;
} Smb2;
} ProtocolSpecific;
template<class _Other>
using UsingTemplatePtr = _Other *;
struct TemplateWithUsingTemplateMember
{
UsingTemplatePtr<TemplateWithUsingTemplateMember> _Ref;
};

Loading…
Cancel
Save