Also for future follow-up work: The Roslyn team recommends not using the GetTypeByMetadataName API and instead using the GetTypesByMetadataName API and handle filtering those results to the correct ones for your scenario (or copying the GetBestTypeByMetadataName API from dotnet/roslyn or dotnet/runtime).
Also for future follow-up work: The Roslyn team recommends not using the
GetTypeByMetadataName
API and instead using theGetTypesByMetadataName
API and handle filtering those results to the correct ones for your scenario (or copying theGetBestTypeByMetadataName
API from dotnet/roslyn or dotnet/runtime)._Originally posted by @jkoritzinsky in https://github.com/dotnet/linker/pull/2939#discussion_r946093119_