Remove leftover generator APIs
このコミットが含まれているのは:
1 親
bb18d79bbf
コミット
a724cb3efe
3ファイル変更
-68
検索条件に一致するファイルはありません
@@ -55,46 +55,4 @@ internal static class CompilationExtensions
|
||||
{
|
||||
return compilation.Options is CSharpCompilationOptions { AllowUnsafe: true };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Checks whether or not a type with a specified metadata name is accessible from a given <see cref="Compilation"/> instance.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// This method enumerates candidate type symbols to find a match in the following order:
|
||||
/// <list type="number">
|
||||
/// <item><description>
|
||||
/// If only one type with the given name is found within the compilation and its referenced assemblies, check its accessibility.
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// If the current <paramref name="compilation"/> defines the symbol, check its accessibility.
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// Otherwise, check whether the type exists and is accessible from any of the referenced assemblies.
|
||||
/// </description></item>
|
||||
/// </list>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="compilation">The <see cref="Compilation"/> to consider for analysis.</param>
|
||||
/// <param name="fullyQualifiedMetadataName">The fully-qualified metadata type name to find.</param>
|
||||
/// <returns>Whether a type with the specified metadata name can be accessed from the given compilation.</returns>
|
||||
public static bool HasAccessibleTypeWithMetadataName(this Compilation compilation, string fullyQualifiedMetadataName)
|
||||
{
|
||||
// If there is only a single matching symbol, check its accessibility
|
||||
if (compilation.GetTypeByMetadataName(fullyQualifiedMetadataName) is INamedTypeSymbol typeSymbol)
|
||||
{
|
||||
return compilation.IsSymbolAccessibleWithin(typeSymbol, compilation.Assembly);
|
||||
}
|
||||
|
||||
// Otherwise, check all available types
|
||||
foreach (INamedTypeSymbol currentTypeSymbol in compilation.GetTypesByMetadataName(fullyQualifiedMetadataName))
|
||||
{
|
||||
if (compilation.IsSymbolAccessibleWithin(currentTypeSymbol, compilation.Assembly))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする