Model: Don't include backtick + digit at end of generic type names

This commit is contained in:
Katy Coe
2019-10-29 20:54:03 +01:00
parent f7eb9395a5
commit 26443f594a

View File

@@ -33,6 +33,8 @@ namespace Il2CppInspector.Reflection {
var s = Namespace + "." + base.Name;
var i = Il2CppConstants.FullNameTypeString.IndexOf(s);
var n = (i != -1 ? Il2CppConstants.CSharpTypeString[i] : base.Name);
if (n?.IndexOf("`", StringComparison.Ordinal) != -1)
n = n?.Remove(n.IndexOf("`", StringComparison.Ordinal));
if (IsArray)
n = ElementType.CSharpName;
var g = (GenericTypeParameters != null ? "<" + string.Join(", ", GenericTypeParameters.Select(x => x.CSharpName)) + ">" : "");
@@ -109,7 +111,7 @@ namespace Il2CppInspector.Reflection {
public override string Name {
get => (IsPointer ? "void *" : "")
+ base.Name
+ (base.Name.IndexOf("`", StringComparison.Ordinal) == -1? base.Name : base.Name.Remove(base.Name.IndexOf("`", StringComparison.Ordinal)))
+ (GenericTypeParameters != null? "<" + string.Join(", ", GenericTypeParameters.Select(x => x.Name)) + ">" : "")
+ (IsArray ? "[]" : "");
protected set => base.Name = value;