From 07a956f07e42e5a7817c8db5d96cde3ca3e8cf89 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Sun, 2 Feb 2020 22:40:28 +0100 Subject: [PATCH] Model: Fix DeclaringType doesn't work for concrete generic instances from TypeSpecs --- Il2CppInspector/Reflection/TypeInfo.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Il2CppInspector/Reflection/TypeInfo.cs b/Il2CppInspector/Reflection/TypeInfo.cs index 444ef51..c5f0f66 100644 --- a/Il2CppInspector/Reflection/TypeInfo.cs +++ b/Il2CppInspector/Reflection/TypeInfo.cs @@ -693,6 +693,9 @@ namespace Il2CppInspector.Reflection { // Same visibility attributes as generic type definition Attributes = genericTypeDefinition.Attributes; + // Even though this isn't a TypeDef, we have to set this so that DeclaringType works in later references + Index = genericTypeDefinition.Index; + // Same name as generic type definition Assembly = genericTypeDefinition.Assembly; Namespace = genericTypeDefinition.Namespace;