From a10f034c9b038cad6f33e2a4ecb818f495269289 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Sun, 5 Jun 2016 16:09:02 +0300 Subject: [PATCH] Fixed the C#-printing of template specilisations with bool. Signed-off-by: Dimitar Dobrev --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 2 ++ tests/CSharp/CSharp.Tests.cs | 2 +- tests/CSharp/CSharpTemplates.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index bdf82841..2deeb55f 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -85,6 +85,7 @@ namespace CppSharp.Generators.CSharp // we don't want internals in the names of internals :) typePrinter.PushContext(CSharpTypePrinterContextKind.Managed); + typePrinter.PushMarshalKind(CSharpMarshalKind.Unknown); var suffix = new StringBuilder(); foreach (var argType in from argType in specialization.Arguments where argType.Type.Type != null @@ -94,6 +95,7 @@ namespace CppSharp.Generators.CSharp suffix.Append(argType); } typePrinter.PopContext(); + typePrinter.PopMarshalKind(); FormatTypesStringForIdentifier(suffix); return suffix.ToString(); } diff --git a/tests/CSharp/CSharp.Tests.cs b/tests/CSharp/CSharp.Tests.cs index e4b1feeb..8e40ac50 100644 --- a/tests/CSharp/CSharp.Tests.cs +++ b/tests/CSharp/CSharp.Tests.cs @@ -510,7 +510,7 @@ public class CSharpTests : GeneratorTestFixture foreach (var internalType in new[] { typeof(CSharp.IndependentFields.Internal), - typeof(CSharp.DependentValueFields.Internal_int), + typeof(CSharp.DependentValueFields.Internal_bool), typeof(CSharp.DependentValueFields.Internal_float), typeof(CSharp.DependentPointerFields.Internal), typeof(CSharp.DependentValueFields.Internal_Ptr), diff --git a/tests/CSharp/CSharpTemplates.h b/tests/CSharp/CSharpTemplates.h index 175d201d..81984b6a 100644 --- a/tests/CSharp/CSharpTemplates.h +++ b/tests/CSharp/CSharpTemplates.h @@ -52,7 +52,7 @@ public: TemplateSpecializer(); private: IndependentFields independentFields; - DependentValueFields dependentValueFields; + DependentValueFields dependentValueFields; DependentPointerFields dependentPointerFields; HasDefaultTemplateArgument hasDefaultTemplateArgument; DependentValueFields dependentPointerFieldsT1;