diff --git a/Il2CppInspector.Common/Reflection/MethodBase.cs b/Il2CppInspector.Common/Reflection/MethodBase.cs index c61948e..a7e4c4b 100644 --- a/Il2CppInspector.Common/Reflection/MethodBase.cs +++ b/Il2CppInspector.Common/Reflection/MethodBase.cs @@ -59,12 +59,12 @@ namespace Il2CppInspector.Reflection public TypeInfo[] GetGenericArguments() => genericArguments; // This was added in .NET Core 2.1 and isn't properly documented yet - public bool IsConstructedGenericMethod => IsGenericMethod && genericArguments.All(ga => !ga.ContainsGenericParameters); + public bool IsConstructedGenericMethod => IsGenericMethod && !IsGenericMethodDefinition; // See: https://docs.microsoft.com/en-us/dotnet/api/system.reflection.methodbase.isgenericmethod?view=netframework-4.8 public bool IsGenericMethod { get; } - public bool IsGenericMethodDefinition => genericArguments.Any() && genericArguments.All(a => a.IsGenericMethodParameter); - + public bool IsGenericMethodDefinition => (Definition != null) && genericArguments.Any(); + // TODO: GetMethodBody() public string CSharpName => diff --git a/Il2CppInspector.Common/Reflection/TypeInfo.cs b/Il2CppInspector.Common/Reflection/TypeInfo.cs index 561ea2c..303779b 100644 --- a/Il2CppInspector.Common/Reflection/TypeInfo.cs +++ b/Il2CppInspector.Common/Reflection/TypeInfo.cs @@ -99,7 +99,7 @@ namespace Il2CppInspector.Reflection { } // True if the type contains unresolved generic type parameters - public bool ContainsGenericParameters => IsGenericParameter || genericArguments.Any(ga => ga.ContainsGenericParameters); + public bool ContainsGenericParameters => (HasElementType && ElementType.ContainsGenericParameters) || IsGenericParameter || genericArguments.Any(ga => ga.ContainsGenericParameters); // Custom attributes for this member public override IEnumerable CustomAttributes => CustomAttributeData.GetCustomAttributes(this);