diff --git a/src/Compilers/Core/Portable/Compilation/Compilation.cs b/src/Compilers/Core/Portable/Compilation/Compilation.cs index c42c6040102f6b638359c630e490e28ae17f0789..a282f0474117e4fdcfff5432bc9a90ffbad2d644 100644 --- a/src/Compilers/Core/Portable/Compilation/Compilation.cs +++ b/src/Compilers/Core/Portable/Compilation/Compilation.cs @@ -2680,21 +2680,11 @@ public ImmutableArray GetUnreferencedAssemblyIdentities(Diagno throw new ArgumentNullException(nameof(diagnostic)); } - if (UnreferencedAssemblyIdentityDiagnosticCodes.Contains(diagnostic.Code)) + if (!UnreferencedAssemblyIdentityDiagnosticCodes.Contains(diagnostic.Code)) { - return ExtractAssemblyIdenties(diagnostic); + return ImmutableArray.Empty; } - return ImmutableArray.Empty; - } - - /// - /// For testing purposes. - /// - internal abstract ImmutableArray UnreferencedAssemblyIdentityDiagnosticCodes { get; } - - internal static ImmutableArray ExtractAssemblyIdenties(Diagnostic diagnostic) - { var builder = ArrayBuilder.GetInstance(); foreach (var argument in diagnostic.Arguments) @@ -2707,5 +2697,7 @@ internal static ImmutableArray ExtractAssemblyIdenties(Diagnos return builder.ToImmutableAndFree(); } + + internal abstract ImmutableArray UnreferencedAssemblyIdentityDiagnosticCodes { get; } } } \ No newline at end of file