diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionInvokeMapNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionInvokeMapNode.cs index 55cfdaba36c12..5014526b677de 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionInvokeMapNode.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionInvokeMapNode.cs @@ -106,9 +106,9 @@ internal static void AddSignatureDependency(ref DependencyList dependencies, Nod TypeDesc canonType = type.ConvertToCanonForm(CanonicalFormKind.Specific); if (canonType.IsCanonicalSubtype(CanonicalFormKind.Any)) - GenericTypesTemplateMap.GetTemplateTypeDependencies(ref dependencies, factory, type.ConvertToCanonForm(CanonicalFormKind.Specific)); + GenericTypesTemplateMap.GetTemplateTypeDependencies(ref dependencies, factory, canonType); else - dependencies.Add(factory.MaximallyConstructableType(canonType), reason); + dependencies.Add(factory.MaximallyConstructableType(type), reason); } public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)