Add non-generic methods to TestGenerics

In order to select the correct generic type, model.GetGenericMethod is
changed to use Name (which includes generic parameters) instead of
BaseName. The tests for GenericMethodDefinitionInGenericClass* are also
changed to reflect the fact that the chosen methods are fully concrete.

TestGenerics now passes in its entirety.
This commit is contained in:
Robert Xiao
2020-04-11 18:11:18 -07:00
committed by Katy
parent c73aad08b8
commit ec6018d012
2 changed files with 10 additions and 9 deletions

View File

@@ -59,7 +59,7 @@ namespace Il2CppInspector.Reflection
// Get a concrete instantiation of a generic method from its fully qualified name and type arguments
public MethodBase GetGenericMethod(string fullName, params TypeInfo[] typeArguments) =>
GenericMethods.Values.First(m => fullName == m.DeclaringType.Namespace + "." + m.DeclaringType.BaseName + "." + m.Name
GenericMethods.Values.First(m => fullName == m.DeclaringType.Namespace + "." + m.DeclaringType.Name + "." + m.Name
&& m.GetGenericArguments().SequenceEqual(typeArguments));
// Create type model