Browse Source

Fixed the printing of template specialisations to work in all cases.

The previous implementation worked with template specialisation types but not, for example, with template parameter substitution types.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/685/head
Dimitar Dobrev 10 years ago
parent
commit
13b5423fff
  1. 7
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs

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

@ -398,9 +398,7 @@ namespace CppSharp.Generators.CSharp
if (ContextKind != CSharpTypePrinterContextKind.Native) if (ContextKind != CSharpTypePrinterContextKind.Native)
return GetNestedQualifiedName(decl); return GetNestedQualifiedName(decl);
var specialization = template.GetClassTemplateSpecialization(); var specialization = template.GetClassTemplateSpecialization();
return string.Format("{0}.Internal{1}", return specialization.Visit(this);
GetNestedQualifiedName(specialization),
Helpers.GetSuffixForInternal(specialization, this));
} }
typeMap.Declaration = decl; typeMap.Declaration = decl;
@ -596,6 +594,9 @@ namespace CppSharp.Generators.CSharp
public CSharpTypePrinterResult VisitClassTemplateSpecializationDecl(ClassTemplateSpecialization specialization) public CSharpTypePrinterResult VisitClassTemplateSpecializationDecl(ClassTemplateSpecialization specialization)
{ {
if (ContextKind == CSharpTypePrinterContextKind.Native)
return string.Format("{0}{1}", VisitClassDecl(specialization),
Helpers.GetSuffixForInternal(specialization, this));
return VisitClassDecl(specialization); return VisitClassDecl(specialization);
} }

Loading…
Cancel
Save