From c12d4e7a9a02f088f6ca6d9452a5990e29ee00e7 Mon Sep 17 00:00:00 2001 From: Deadlocklogic Date: Sun, 17 Dec 2023 17:58:14 +0200 Subject: [PATCH] LuaSolSources: fix ClassTemplatePartialSpecialization Parameters --- .../Generators/Registrable/Lua/Sol/LuaSolSources.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Generator/Generators/Registrable/Lua/Sol/LuaSolSources.cs b/src/Generator/Generators/Registrable/Lua/Sol/LuaSolSources.cs index 84a468376..f1a15576b 100644 --- a/src/Generator/Generators/Registrable/Lua/Sol/LuaSolSources.cs +++ b/src/Generator/Generators/Registrable/Lua/Sol/LuaSolSources.cs @@ -1877,23 +1877,22 @@ public virtual void GenerateClassTemplateSpecializationDeclFunctorValueType(Clas public virtual void GenerateClassTemplateSpecializationDeclBegin(ClassTemplateSpecialization specialization) { + ClassTemplatePartialSpecialization classTemplatePartialSpecialization = specialization as ClassTemplatePartialSpecialization; Write("template <"); if (specialization.Access == AccessSpecifier.Protected) { Write("typename Importer>"); - if (specialization is ClassTemplatePartialSpecialization) + if (classTemplatePartialSpecialization != null) { - // TODO: provisional and WRONG: see https://github.com/mono/CppSharp/issues/1801 - if (specialization.TemplatedDecl.Parameters.Count > 0) + if (classTemplatePartialSpecialization.Parameters.Count > 0) { Write(", "); } } } - if (specialization is ClassTemplatePartialSpecialization) + if (classTemplatePartialSpecialization != null) { - // TODO: provisional and WRONG: see https://github.com/mono/CppSharp/issues/1801 - Write(NamingStrategy.PrintClassTemplateParameters(specialization.TemplatedDecl.Parameters, false, TemplateParameterOption.AsParameter)); + Write(NamingStrategy.PrintClassTemplateParameters(classTemplatePartialSpecialization.Parameters, false, TemplateParameterOption.AsParameter)); } WriteLine(">"); WriteLine(string.Format("struct {0}{1} {{",