Model: Temporary hack to ensure concrete type parameter substitution works

This commit is contained in:
Katy Coe
2020-02-02 06:47:37 +01:00
parent f715586b3b
commit 25e35be59f

View File

@@ -104,7 +104,9 @@ namespace Il2CppInspector.Reflection
Attributes = generic.Attributes;
// TODO: Duplicate instances of 'concrete' may cause this search to fail. Replace with a straight lookup after eliminating GetTypeFromVirtualAddress
paramTypeReference = Array.IndexOf(model.TypesByReferenceIndex, concrete);
//paramTypeReference = Array.IndexOf(model.TypesByReferenceIndex, concrete);
// TODO: Get rid of this slow and filthy hack to force finding the correct type reference
paramTypeReference = model.TypesByReferenceIndex.Select((v, i) => new {i, v}).First(t => t.v.ToString() == concrete.ToString()).i;
DefaultValue = generic.DefaultValue;
DefaultValueMetadataAddress = generic.DefaultValueMetadataAddress;