Change generic params/args to arrays

The C# functions for GetGenericParameters/GetGenericArguments use
Type[], not lists, so we should conform to that.

Also fix the definition of IsGenericTypeDefinition - because it's
possible for a class to be instantiated with all generic parameters.
This commit is contained in:
Robert Xiao
2020-04-11 00:13:22 -07:00
committed by Katy
parent 996fb1ff36
commit 2c164aec02
3 changed files with 11 additions and 11 deletions

View File

@@ -146,12 +146,12 @@ namespace Il2CppInspector.Reflection
}
// Get generic arguments from either a type or method instanceIndex from a MethodSpec
public List<TypeInfo> ResolveGenericArguments(Il2CppGenericInst inst) {
public TypeInfo[] ResolveGenericArguments(Il2CppGenericInst inst) {
// Get list of pointers to type parameters (both unresolved and concrete)
var genericTypeArguments = Package.BinaryImage.ReadMappedWordArray(inst.type_argv, (int)inst.type_argc);
return genericTypeArguments.Select(a => GetTypeFromVirtualAddress((ulong) a)).ToList();
return genericTypeArguments.Select(a => GetTypeFromVirtualAddress((ulong) a)).ToArray();
}
// Get a TypeRef by its virtual address