498 references to HDN_UnusedUsingDirective
Microsoft.CodeAnalysis.CSharp (3)
Compilation\CSharpCompilation.cs (1)
2404: ErrorCode.HDN_UnusedUsingDirective;
Errors\ErrorFacts.cs (1)
1611case ErrorCode.HDN_UnusedUsingDirective:
Generated\ErrorFacts.Generated.cs (1)
356case ErrorCode.HDN_UnusedUsingDirective:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (52)
CodeGen\CodeGenAsyncIteratorTests.cs (1)
7573Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Runtime.CompilerServices;").WithLocation(2, 1),
CodeGen\CodeGenAsyncMainTests.cs (2)
248Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(2, 1)); 285Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(2, 1));
CodeGen\CodeGenAwaitForeachTests.cs (2)
7849Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N3;").WithLocation(5, 1)); 7954Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N2;").WithLocation(5, 1),
CodeGen\CodeGenForEachTests.cs (1)
5073Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N2;").WithLocation(4, 1),
CodeGen\CodeGenOperators.cs (2)
2296Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;").WithLocation(3, 1), 2299Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;").WithLocation(4, 1),
CodeGen\CodeGenTupleTest.cs (2)
5411Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using VT2 = (int, int);").WithLocation(2, 1)); 5418Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using VT2 = (int, int);").WithLocation(2, 1));
PDB\PDBUsingTests.cs (41)
880Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Y = B::N;").WithLocation(5, 1), 883Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = A::N;").WithLocation(4, 1), 886Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Z = global::N;").WithLocation(6, 1)); 1027Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"), 1030Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AU1 = System;"), 1033Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AT1 = System.Char;"), 1039Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AU2 = System.IO;"), 1042Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AT2 = System.IO.Directory;"), 1045Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.IO;"), 1051Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AT3 = System.Text.StringBuilder;"), 1054Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Text;"), 1057Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AU3 = System.Text;"), 1333Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"), 1336Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AU1 = System;"), 1339Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AT1 = System.Char;"), 1345Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AU3 = System.Threading;"), 1348Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AT3 = System.Threading.Thread;"), 1351Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Threading;"), 1357Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AU2 = System.IO;"), 1360Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AT2 = System.IO.Directory;"), 1363Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.IO;"), 1512Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"), 1515Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AU1 = System;"), 1518Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AT1 = System.Char;"), 1524Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Text;"), 1527Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AU3 = System.Text;"), 1530Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AT3 = System.Text.StringBuilder;"), 1533Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AU2 = System.IO;"), 1539Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AT2 = System.IO.Directory;"), 1542Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.IO;"), 1545Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AU4 = System.Threading;"), 1551Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using AT4 = System.Threading.Thread;"), 1554Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Threading;"), 2496Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Y = A::E;").WithLocation(5, 1), 2499Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using B;").WithLocation(3, 1), 2502Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = C.D;").WithLocation(4, 1), 2505Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Z = F<int>;").WithLocation(6, 1) 2621Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static N.SBad;"), 2624Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using NIBad = N.IBad;"), 2627Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using ZBad = N.SBad;")); 2691Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = N.B;"));
Perf.cs (1)
36Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using nested;"));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Attributes\AttributeTests.cs (1)
8141Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"));
Attributes\AttributeTests_WellKnownAttributes.cs (2)
7211Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = A;"), 7214Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Y = A.B;"));
Semantics\PatternMatchingTests2.cs (1)
1279Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using _ = System.Int32;").WithLocation(1, 1)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests (3)
DebuggerDisplayAttributeTests.cs (3)
300Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using A = int;").WithLocation(2, 1), 303Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using B = (int, int);").WithLocation(3, 1), 306Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using C = int[];").WithLocation(4, 1));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (216)
Semantics\BindingTests.cs (3)
3385Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static Test<System.String>;").WithLocation(2, 1), 3405Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static A<A<int>[]>.B;").WithLocation(2, 1), 3421Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static A<int, string>;").WithLocation(2, 1),
Semantics\FunctionPointerTests.cs (9)
45Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using s = delegate*<void>;").WithLocation(2, 1)); 57Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using s = delegate*<void>;").WithLocation(2, 1)); 74Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe S = delegate*<void>;").WithLocation(2, 1)); 81Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe S = delegate*<void>;").WithLocation(2, 1)); 88Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe S = delegate*<void>;").WithLocation(2, 1)); 101Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using S = System.Collections.Generic.List<delegate*<void>[]>;").WithLocation(2, 1)); 107Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using S = System.Collections.Generic.List<delegate*<void>[]>;").WithLocation(2, 1), 126Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe S = System.Collections.Generic.List<delegate*<void>[]>;").WithLocation(2, 1)); 132Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe S = System.Collections.Generic.List<delegate*<void>[]>;").WithLocation(2, 1));
Semantics\GlobalUsingDirectiveTests.cs (157)
887comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 890comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 893comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 896comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 958comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 961comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 964comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 1062comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 1112comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 1531comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 1551comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 1554comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 1557comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 1591comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 1611comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 1614comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 1928comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 1964comp.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2074comp2.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify( 2084comp3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify( 2097comp4.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify( 2127comp5.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(expected1); 2130comp6.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify( 2140comp7.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify( 2153comp8.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(expected1); 2156comp9.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify( 2169comp10.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify( 2216comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(expected); 2219comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDeclarationDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(expected); 2251comp2.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2265comp3.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2268comp4.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2271comp5.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2274comp6.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2277comp7.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2280comp8.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2283comp9.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2301comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2308comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2338comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 2341comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 2344comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 2396comp2.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2413comp3.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2416comp4.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2419comp5.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2422comp6.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2425comp7.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2428comp8.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2431comp9.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2492comp2.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2509comp3.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2512comp4.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2515comp5.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2518comp6.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2521comp7.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2524comp8.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2527comp9.GetDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 2557CompileAndVerify(comp2).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2561CompileAndVerify(comp3).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2571CompileAndVerify(comp4).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2578CompileAndVerify(comp5).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2588CompileAndVerify(comp6).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2598CompileAndVerify(comp7).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2608CompileAndVerify(comp8).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2611CompileAndVerify(comp9).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2635comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2642comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2671comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 2674comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 2677comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2711CompileAndVerify(comp2).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2715CompileAndVerify(comp3).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2725CompileAndVerify(comp4).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2732CompileAndVerify(comp5).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2742CompileAndVerify(comp6).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2752CompileAndVerify(comp7).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2762CompileAndVerify(comp8).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 2765CompileAndVerify(comp9).Diagnostics.Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2789comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2796comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2825comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 2828comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected); 2831comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 2877Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using alias1 = C2;").WithLocation(1000, 1), 2880Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using alias3 = C4;").WithLocation(3000, 1), 2883Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using alias4 = C2;").WithLocation(4000, 1) 2892Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using alias1 = C2;").WithLocation(1000, 1) 2899Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using alias3 = C4;").WithLocation(3000, 1), 2902Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using alias4 = C2;").WithLocation(4000, 1) 2963Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using static C2;").WithLocation(1000, 1), 2966Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using static C4;").WithLocation(3000, 1), 2969Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static C5;").WithLocation(4000, 1) 2978Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using static C2;").WithLocation(1000, 1) 2985Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using static C4;").WithLocation(3000, 1), 2988Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static C5;").WithLocation(4000, 1) 3049Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using C2;").WithLocation(1000, 1), 3052Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using C4;").WithLocation(3000, 1), 3055Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using C5;").WithLocation(4000, 1) 3064Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using C2;").WithLocation(1000, 1) 3071Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using C4;").WithLocation(3000, 1), 3074Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using C5;").WithLocation(4000, 1) 3177Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using N2;").WithLocation(1000, 1), 3180Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N5;").WithLocation(4000, 1), 3183Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N8;").WithLocation(6000, 1), 3210Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using N2;").WithLocation(1000, 1), 3223Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N5;").WithLocation(4000, 1), 3236Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N8;").WithLocation(6000, 1), 3385Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using alias2 = System;").WithLocation(4, 1) 3393Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using alias2 = System;").WithLocation(4, 1) 3401Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using alias2 = System;").WithLocation(2, 1) 3409Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using alias2 = System;").WithLocation(2, 1) 3417Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using alias2 = System;").WithLocation(2, 1) 3425Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using alias2 = System;").WithLocation(2, 1) 3433Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using alias2 = System;").WithLocation(2, 1) 3441Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using alias2 = System;").WithLocation(2, 1) 4221comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected1); 4224comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected1); 4227comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify( 4241comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected2); 4249comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected2); 4257comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected1); 4260comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected1); 4263comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify( 4277comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected3); 4285comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected3); 4293comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected3); 4301comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected3); 4309comp.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify( 4375comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 4378comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 4381comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 4384comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 4387comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 4394comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 4401comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 4471comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 4474comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 4477comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 4480comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 4483comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 4490comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 4497comp.GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 4568Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using NS;").WithLocation(1000, 1) 4586Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using static C2;").WithLocation(2000, 1) 4602Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using NS;").WithLocation(3000, 1) 4613Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static C2;").WithLocation(4000, 1) 4684Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using NS;").WithLocation(1000, 1) 4717Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using static C2;").WithLocation(2000, 1) 4750Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using NS;").WithLocation(3000, 1) 4771Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static C2;").WithLocation(4000, 1) 4926GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 4929GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 4932GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1); 4945GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 4948GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2); 4951GetDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
Semantics\InheritanceBindingTests.cs (1)
1373Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using @str = System.String;").WithLocation(2, 1));
Semantics\LookupTests.cs (1)
1621Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using A = List<int>;").WithLocation(1, 1));
Semantics\NameCollisionTests.cs (2)
2002Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static Static<System.String>;").WithLocation(3, 1)); 2034Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static Static<string>;").WithLocation(2, 1));
Semantics\NativeIntegerTests.cs (5)
3837Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using A=nint;").WithLocation(1, 1), 3846Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using A=nint;").WithLocation(1, 1), 3855Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using A=nint;").WithLocation(1, 1), 3921Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using nint;").WithLocation(1, 1), 3927Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using nuint;").WithLocation(2, 1),
Semantics\NullableReferenceTypesTests.cs (2)
14427Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;").WithLocation(4, 1), 14430Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Text;").WithLocation(5, 1),
Semantics\OverloadResolutionTests.cs (1)
7594Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;").WithLocation(2, 1)
Semantics\PrimaryConstructorTests.cs (2)
8866comp.GetEmitDiagnostics().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify( 10767var diagnostics = verifier.Diagnostics.Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective);
Semantics\QueryTests.cs (1)
3594Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;"));
Semantics\RecordTests.cs (3)
2903Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using record = System.Console;").WithLocation(2, 1), 2920Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using @record = System.Console;").WithLocation(2, 1) 24433Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(1, 1),
Semantics\RefFieldTests.cs (4)
21748Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using scoped = System.Int32;").WithLocation(1, 1), 21758Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using scoped = System.Int32;").WithLocation(1, 1), 21775Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using @scoped = System.Int32;").WithLocation(1, 1) 21782Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using @scoped = System.Int32;").WithLocation(1, 1)
Semantics\SemanticErrorTests.cs (1)
2420Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(1, 1)
Semantics\TopLevelStatementsTests.cs (2)
3769Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static N2;").WithLocation(2, 1), 3837Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static N2;").WithLocation(2, 1),
Semantics\UnsafeTests.cs (22)
9848Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = int*;").WithLocation(2, 1), 9868Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = int;").WithLocation(2, 1), 9884Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = int*;").WithLocation(2, 1), 9903Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = int;").WithLocation(2, 1), 9922Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = int*;").WithLocation(2, 1), 9938Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = int;").WithLocation(2, 1), 9954Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = System.String;").WithLocation(2, 1), 9973Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = System.String;").WithLocation(2, 1), 10022Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Y = X;").WithLocation(5, 5), 10042Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe Y = X;").WithLocation(5, 5)); 10060Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = int*;").WithLocation(2, 1), 10133Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = int*[];").WithLocation(2, 1)); 10146Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = int*[];").WithLocation(2, 1), 10279Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = delegate*<int,int>;").WithLocation(2, 1), 10325Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = delegate*<int,int>[];").WithLocation(2, 1), 10328Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Y = delegate*<int,int>[];").WithLocation(3, 1), 10441Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = System.Collections.Generic.List<int*>;").WithLocation(2, 1), 10457Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = System.Collections.Generic.List<int*>;").WithLocation(2, 1), 10598Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = System.Collections.Generic.List<int*[]>;").WithLocation(2, 1) 10610Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = System.Collections.Generic.List<int*[]>;").WithLocation(2, 1), 10706Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = System.Collections.Generic.List<int*[]>;").WithLocation(2, 1)); 10712Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe X = System.Collections.Generic.List<int*[]>;").WithLocation(2, 1),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (100)
Compilation\GetUnusedImportDirectivesTests.cs (18)
38Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;")); 102model.GetDiagnostics().Verify(Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using ClassLibrary2;")); 133Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;"), 136Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"), 139Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 142Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Threading.Tasks;") 149Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"), 152Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 155Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Threading.Tasks;") 205Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;") 285Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections;"), 288Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;") 295Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections;"), 298Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;") 333Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections;"), 336Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using C = System.Console;")); 383Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithWarningAsError(false)); 404Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"));
Compilation\SemanticModelAPITests.cs (2)
1240Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = System;")); 1333Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = System;"));
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
4529Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Alias = Goo;")); 4566Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Alias = Goo;"));
Compilation\UsedAssembliesTests.cs (20)
219if (old.Code is (int)ErrorCode.HDN_UnusedUsingDirective) 1839Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static C1;").WithLocation(1001, 1), 2179Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N1;").WithLocation(1001, 1) 2192Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static N1.C1;").WithLocation(1001, 1) 2205Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using @alias = N1.C1;").WithLocation(1001, 1) 2218Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using @alias = N1;").WithLocation(1001, 1) 2244Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N1;").WithLocation(2, 1) 2257Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static N1.C1;").WithLocation(2, 1) 2270Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using @alias = N1.C1;").WithLocation(2, 1) 2283Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using @alias = N1;").WithLocation(2, 1) 4461Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N1.N2;").WithLocation(1001, 1) 4466Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N1.N2;").WithLocation(1001, 1), 4490Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N1;").WithLocation(1001, 1) 4495Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N1;").WithLocation(1001, 1), 4681Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static N1.N2.E0;").WithLocation(1001, 1) 4686Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static N1.N2.E0;").WithLocation(1001, 1), 5187Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static C1;").WithLocation(1001, 1), 5209Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static C1;").WithLocation(1001, 1), 5248Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static C1;").WithLocation(1001, 1), 5287Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static C1;").WithLocation(1001, 1),
DocumentationComments\CrefTests.cs (2)
5281Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;")); 6867Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(1, 1));
Symbols\AssemblyAndNamespaceTests.cs (4)
425Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Threading;"), 428Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Threading.Tasks;"), 561Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(1, 1)); 574Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(2, 1));
Symbols\ExtensionMethodTests.cs (3)
3410Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using NB;")); 3708Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static Program;").WithLocation(4, 5)); 3743Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = N.S;").WithLocation(4, 5));
Symbols\GenericConstraintTests.cs (4)
789Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using A = C<int>;")); 823Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using A = C<I<int?>>;"), 826Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using B1 = C<I<int>>.D1<object>;"), 829Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using B2 = C<int>.D2<string>;"));
Symbols\Metadata\PE\TypeForwarders.cs (2)
951Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Namespace;")); 987Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Namespace;"));
Symbols\Source\BaseClassTests.cs (4)
1983Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using D;").WithLocation(2, 1), 1986Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using A<int>.B;").WithLocation(1, 1) 2010Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static A<int>.B;").WithLocation(1, 1) 2207Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using CrashTest.Crash<CrashTest.Class2>;").WithLocation(2, 1)
Symbols\Source\ExternAliasTests.cs (1)
167Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Bar = System.Console;"),
Symbols\Source\FileModifierTests.cs (3)
2835Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using static C;").WithLocation(1, 1), 2874Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using static Container<C>;").WithLocation(1, 1), 2993Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static C;").WithLocation(2, 1));
Symbols\SymbolErrorTests.cs (33)
2538Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Object;"), 2541Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using NS.S;")); 3407Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using NoExistNS1;"), 3410Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using NoExistNS2;")); 3859Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using NIA = N.IA;").WithLocation(1, 1)); 4441Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(1, 1), 4492Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using COfArgIterator = C<System.ArgIterator>;").WithLocation(3, 1)); 4515Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using COfArgIterator = C<System.ArgIterator>;").WithLocation(3, 1)); 14991Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using A = System;"), 14994Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using A = System;"), 14997Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using O = System.Object;"), 15000Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using O = System.Object;")); 15043Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(15, 5), 15046Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using ns = namespace2;").WithLocation(14, 5)); 15064Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = System;"), 15067Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = ABC.X<int>;")); 16913Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"), 16916Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"), 16919Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"), 16922Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Goo.Bar;")); 17864Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;")); 20129Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using A = A;").WithLocation(1, 1), 20132Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using B;").WithLocation(4, 5)); 21313Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using one = System.Console;").WithLocation(2, 1), 21319Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using @two = System.Console;").WithLocation(3, 1), 21322Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using three = System;").WithLocation(4, 1), 21328Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Ten = System.Console;").WithLocation(5, 1), 21331Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using cédille = System.Console;").WithLocation(6, 1) 21341Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using one = System.Console;").WithLocation(2, 1), 21344Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using @two = System.Console;").WithLocation(3, 1), 21347Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using three = System;").WithLocation(4, 1), 21350Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Ten = System.Console;").WithLocation(5, 1), 21353Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using cédille = System.Console;").WithLocation(6, 1)
Symbols\TypeTests.cs (2)
713Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;")); 750Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (48)
Parsing\ParserErrorMessageTests.cs (6)
1924Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(1, 1)); 2183Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(2, 1)); 2819Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(2, 1)); 5473Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using N1Alias = N1;").WithLocation(2, 1), 5476Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;").WithLocation(1, 1)); 5935Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using global = MyClass;").WithLocation(2, 1));
Parsing\UsingDirectiveParsingTests.cs (36)
363Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static x = ref int;").WithLocation(1, 1), 618Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using x = A*;").WithLocation(1, 1), 672Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe x = A*;").WithLocation(1, 1), 722Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using x = delegate*<int, void>;").WithLocation(1, 1), 784Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe x = delegate*<int, void>;").WithLocation(1, 1), 844Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe System;").WithLocation(1, 1), 875Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using static unsafe System.Console;").WithLocation(1, 1), 914Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using x = int;").WithLocation(1, 1), 954Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using x = int;").WithLocation(1, 1), 991Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using x = int;").WithLocation(1, 1), 1028Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using x = ref int;").WithLocation(1, 1), 1072Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using x = ref readonly int;").WithLocation(1, 1), 1117Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using x = int*;").WithLocation(1, 1), 1161Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe x = int*;").WithLocation(1, 1), 1209Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Y = X;").WithLocation(6, 5), 1284Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe Y = X;").WithLocation(6, 5)); 1360Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe Y = X;").WithLocation(6, 5)); 1432Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Y = X[];").WithLocation(6, 5), 1519Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using unsafe Y = X[];").WithLocation(6, 5)); 1598Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using x = (int, int);").WithLocation(1, 1), 1860Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using x = int?;").WithLocation(1, 1), 1901Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using x = string?;").WithLocation(1, 1), 1951Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = string?;").WithLocation(2, 1), 1998Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Y = X?;").WithLocation(4, 5), 2076Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using Y = X?;").WithLocation(5, 5), 2601Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using dynamic;").WithLocation(2, 1), 3200Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = int?;").WithLocation(1, 1), 3203Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = System;").WithLocation(2, 1), 3264Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = int?;").WithLocation(1, 1), 3267Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = int;").WithLocation(2, 1), 3328Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = int?;").WithLocation(1, 1), 3331Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = System.Int32;").WithLocation(2, 1), 3401Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = int?;").WithLocation(1, 1), 3404Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = int;").WithLocation(3, 1)); 4002Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = __arglist;").WithLocation(2, 1), 4047Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using X = __makeref;").WithLocation(2, 1),
Syntax\SyntaxTreeTests.cs (6)
370Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using ns1;").WithLocation(1, 1), 442Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using ns1;").WithLocation(1, 16), 512Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using static ns1;").WithLocation(1, 1), 586Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using static ns1;").WithLocation(1, 16), 664Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using alias = ns1;").WithLocation(1, 1), 755Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "global using alias = ns1;").WithLocation(1, 16),
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
1290if (!compileDiagnostics.Any(d => d.Code == (int)ErrorCode.HDN_UnusedExternAlias || d.Code == (int)ErrorCode.HDN_UnusedUsingDirective))
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (71)
CodeGen\WinRTCollectionTests.cs (71)
442Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 445Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 448Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 1470Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 1473Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 1476Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 1840Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 1843Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 1846Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 3200Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 3203Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 3206Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 4443Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 4446Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 4449Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 4809Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 4812Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 4815Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 4996Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 4999Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 5002Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 5194Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 5197Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 5200Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;")); 5413Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 5416Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 5419Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 5422Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 5550Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 5553Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 5556Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 5559Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 5704Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;").WithLocation(2, 1), 5707Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Threading;").WithLocation(4, 1), 5710Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Runtime.InteropServices;").WithLocation(3, 1)); 5820Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 5823Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 5826Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 5829Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 6047Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 6050Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 6053Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 6056Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;"), 6059Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections;")); 6246Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 6249Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 6252Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 6605Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 6608Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 6611Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 6614Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 6766Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 6769Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 6772Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 6775Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;")); 7038Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 7041Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 7044Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 7047Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;"), 7050Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections;")); 7165Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 7168Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 7171Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 7174Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;"), 7177Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections;")); 7286Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections.Generic;"), 7289Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Reflection;"), 7292Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq.Expressions;"), 7295Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Linq;"), 7298Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System.Collections;")); 7390Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using System;"));