Browse Source

Template type alias cast fix

pull/1904/head
duckdoom5 4 months ago
parent
commit
e30ab8daab
  1. 7
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs

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

@ -306,7 +306,12 @@ namespace CppSharp.Generators.CSharp
template.Arguments.All(IsValid)) template.Arguments.All(IsValid))
{ {
List<TemplateArgument> args = template.Arguments; List<TemplateArgument> args = template.Arguments;
var @class = (Class)template.Template.TemplatedDecl; var templateDecl = template.Template.TemplatedDecl;
if (templateDecl is TypeAlias typeAlias)
return typeAlias.Visit(this);
var @class = templateDecl as Class;
TemplateArgument lastArg = args.Last(); TemplateArgument lastArg = args.Last();
TypePrinterResult typePrinterResult = VisitDeclaration(decl); TypePrinterResult typePrinterResult = VisitDeclaration(decl);
typePrinterResult.NameSuffix.Append($@"<{string.Join(", ", typePrinterResult.NameSuffix.Append($@"<{string.Join(", ",

Loading…
Cancel
Save