Remove generic suffix from type names in ILangExtensions

This commit is contained in:
Thorsten Sommer 2025-04-27 13:24:05 +02:00
parent 09d87d2443
commit b1c0cb3a42
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -12,6 +12,10 @@ public static class ILangExtensions
typeName ??= type.Name;
typeNamespace ??= type.Namespace!;
// When the type's name ends with `1 or 2`, etc. (i.e., generic classes), remove it:
if(typeName.Contains("`"))
typeName = typeName[..typeName.IndexOf('`')];
var ns = $"{typeNamespace}::{typeName}".ToUpperInvariant().Replace(".", "::");
var key = $"root::{ns}::T{fallbackEN.ToFNV32()}";