Skip to content

Move analyzers to GetBestTypeByMetadataName #43341

@sharwell

Description

@sharwell

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions