Only include GenericMethod definers in Types

Including *every* generated type in Types defeats the purpose of the
Types property, which is to list all types directly referred to by the
Il2Cpp metadata. Therefore, we return to the previous implementation:
only list types referred to by DefinitionIndex, ReferenceIndex, and
classIndexIndex.
This commit is contained in:
Robert Xiao
2020-04-12 15:16:01 -07:00
committed by Katy
parent f395ed3ff5
commit 6fb95c52da
2 changed files with 2 additions and 20 deletions

View File

@@ -32,13 +32,8 @@ namespace Il2CppInspector.Reflection
public Dictionary<string, TypeInfo> TypesByFullName { get; } = new Dictionary<string, TypeInfo>();
// Every type
public IEnumerable<TypeInfo> Types {
get {
var result = new IEnumerable<TypeInfo>[] { TypesByDefinitionIndex, TypesByReferenceIndex }.SelectMany(t => t);
result = result.Concat(result.SelectMany(t => t.CachedGeneratedTypes));
return result.Distinct();
}
}
public IEnumerable<TypeInfo> Types => TypesByDefinitionIndex.Concat(TypesByReferenceIndex)
.Concat(GenericMethods.Values.Select(m => m.DeclaringType)).Distinct();
// List of all methods ordered by their MethodDefinitionIndex
public MethodBase[] MethodsByDefinitionIndex { get; }