diff --git a/Il2CppInspector/Reflection/ConstructorInfo.cs b/Il2CppInspector/Reflection/ConstructorInfo.cs index d5d9d94..36ff03b 100644 --- a/Il2CppInspector/Reflection/ConstructorInfo.cs +++ b/Il2CppInspector/Reflection/ConstructorInfo.cs @@ -22,7 +22,7 @@ namespace Il2CppInspector.Reflection public override string ToString() => DeclaringType.Name + "(" + string.Join(", ", DeclaredParameters.Select(x => x.ParameterType.Name)) + ")"; - public override string GetSignatureString(Scope usingScope) => Name + GetTypeParametersString(usingScope) + public override string GetSignatureString() => Name + GetFullTypeParametersString() + "(" + string.Join(",", DeclaredParameters.Select(x => x.GetSignatureString())) + ")"; } } \ No newline at end of file diff --git a/Il2CppInspector/Reflection/MethodBase.cs b/Il2CppInspector/Reflection/MethodBase.cs index 82c620a..977919f 100644 --- a/Il2CppInspector/Reflection/MethodBase.cs +++ b/Il2CppInspector/Reflection/MethodBase.cs @@ -173,7 +173,7 @@ namespace Il2CppInspector.Reflection modifiers.Append("extern "); // Method hiding - if ((DeclaringType.BaseType?.GetAllMethods().Any(m => m.GetSignatureString(usingScope) == GetSignatureString(usingScope) && m.IsHideBySig) ?? false) + if ((DeclaringType.BaseType?.GetAllMethods().Any(m => m.GetSignatureString() == GetSignatureString() && m.IsHideBySig) ?? false) && (((Attributes & MethodAttributes.VtableLayoutMask) == MethodAttributes.ReuseSlot && !IsVirtual) || (Attributes & MethodAttributes.VtableLayoutMask) == MethodAttributes.NewSlot)) modifiers.Append($"new "); @@ -194,7 +194,10 @@ namespace Il2CppInspector.Reflection public string GetTypeParametersString(Scope usingScope) => GenericTypeParameters == null? "" : "<" + string.Join(", ", GenericTypeParameters.Select(p => p.GetScopedCSharpName(usingScope))) + ">"; - public abstract string GetSignatureString(Scope usingScope); + public string GetFullTypeParametersString() => GenericTypeParameters == null? "" : + "[" + string.Join(",", GenericTypeParameters.Select(p => p.FullName ?? p.Name)) + "]"; + + public abstract string GetSignatureString(); // List of operator overload metadata names // https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/operator-overloads diff --git a/Il2CppInspector/Reflection/MethodInfo.cs b/Il2CppInspector/Reflection/MethodInfo.cs index fada3ee..4b12241 100644 --- a/Il2CppInspector/Reflection/MethodInfo.cs +++ b/Il2CppInspector/Reflection/MethodInfo.cs @@ -33,7 +33,7 @@ namespace Il2CppInspector.Reflection // TODO: Generic arguments (and on ConstructorInfo) public override string ToString() => ReturnType.Name + " " + Name + "(" + string.Join(", ", DeclaredParameters.Select(x => x.ParameterType.Name)) + ")"; - public override string GetSignatureString(Scope usingScope) => ReturnParameter.GetSignatureString() + " " + Name + GetTypeParametersString(usingScope) + public override string GetSignatureString() => ReturnParameter.GetSignatureString() + " " + Name + GetFullTypeParametersString() + "(" + string.Join(",", DeclaredParameters.Select(x => x.GetSignatureString())) + ")"; } } \ No newline at end of file