Currently many analyzers in dotnet/roslyn use Compilation.GetTypeByMetadataName. This method does not handle multiple definitions of types (even when only one is accessible), which leads to failures such as the one fixed in #43205. The Compilation.GetTypeByMetadataName method should be added to the banned APIs, and analyzers updated to use CompilationExtensions.GetBestTypeByMetadataName instead.
Currently many analyzers in dotnet/roslyn use
Compilation.GetTypeByMetadataName. This method does not handle multiple definitions of types (even when only one is accessible), which leads to failures such as the one fixed in #43205. TheCompilation.GetTypeByMetadataNamemethod should be added to the banned APIs, and analyzers updated to useCompilationExtensions.GetBestTypeByMetadataNameinstead.