Lokad / ILPack

Serialize .NET Core assemblies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to look up MethodDefinition for constructed generic method

masonwheeler opened this issue · comments

In Lokad.ILPack.Metadata.AssemblyMetadata.TryGetMethodDefinition, if passed a MethodInfo representing a constructed generic method on a non-generic type, the following sequence occurs.

  1. if (methodInfo.DeclaringType.IsConstructedGenericType) is false. The type is not generic.
  2. _methodDefHandles.TryGetValue(methodInfo, out metadata) returns false, because the cache contains the generic method definition

(A similar problem exists on TryGetFieldDefinition for fields on constructed generic types.)