45 references to ERR_DuplicateCaseLabel
Microsoft.CodeAnalysis.CSharp (3)
Binder\SwitchBinder_Patterns.cs (2)
120
diagnostics.Add(ErrorCode.
ERR_DuplicateCaseLabel
, syntax.Location, cp.ConstantValue.GetValueToDisplay());
264
diagnostics.Add(ErrorCode.
ERR_DuplicateCaseLabel
, node.Location, label.Name);
Errors\ErrorFacts.cs (1)
745
or ErrorCode.
ERR_DuplicateCaseLabel
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\SwitchTests.cs (2)
9976
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case Generic<dynamic>.Color.Red:").WithArguments("1").WithLocation(18, 13),
9979
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case Generic<(int z, int w)>.Color.Blue:").WithArguments("2").WithLocation(19, 13)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (17)
Semantics\PatternMatchingTests.cs (1)
5681
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "default:").WithArguments("default").WithLocation(9, 13)
Semantics\PatternMatchingTests4.cs (2)
8174
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 1:").WithArguments("1").WithLocation(42, 5),
8177
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 1:").WithArguments("1").WithLocation(49, 5),
Semantics\PatternSwitchTests.cs (14)
44
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 1:").WithArguments("1").WithLocation(11, 13),
1348
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 1.01:").WithArguments(1.01.ToString()).WithLocation(13, 13),
1351
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case -0.0:").WithArguments((-0.0).ToString()).WithLocation(34, 13),
1354
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case -double.NaN:").WithArguments((-double.NaN).ToString()).WithLocation(35, 13),
1357
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 1.01f:").WithArguments(1.01f.ToString()).WithLocation(46, 13),
1360
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case -0.0f:").WithArguments((-0.0f).ToString()).WithLocation(67, 13),
1363
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case -float.NaN:").WithArguments((-float.NaN).ToString()).WithLocation(68, 13),
1366
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 1.01m:").WithArguments(1.01m.ToString()).WithLocation(78, 13),
1369
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case -0.0m:").WithArguments((-0.0m).ToString()).WithLocation(99, 13)
3057
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case (string)null:").WithArguments("null").WithLocation(37, 13)
3612
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case (System.IntPtr)2:").WithArguments("2").WithLocation(11, 13)
3658
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case (nint)2:").WithArguments("2").WithLocation(11, 13)
3710
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case (System.UIntPtr)2:").WithArguments("2").WithLocation(11, 13)
3756
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case (nuint)2:").WithArguments("2").WithLocation(11, 13)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_ISwitchOperation.cs (1)
1122
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "default:").WithArguments("default").WithLocation(14, 13),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (21)
Semantics\ConstantTests.cs (1)
3439
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case (object)null:").WithArguments("null").WithLocation(21, 13));
Semantics\SemanticErrorTests.cs (1)
4378
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 1:").WithArguments("1").WithLocation(16, 13)
Semantics\SwitchTests.cs (19)
195
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 1:").WithArguments("1").WithLocation(11, 13),
198
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 'f':").WithArguments("f").WithLocation(23, 13)
203
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 1:").WithArguments("1").WithLocation(11, 13),
206
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 'f':").WithArguments("f").WithLocation(23, 13)
258
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 1:").WithArguments("1").WithLocation(11, 13),
261
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 97:").WithArguments("97").WithLocation(23, 13),
270
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 97.0f:").WithArguments("a").WithLocation(34, 13),
273
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 'a':").WithArguments("a").WithLocation(36, 13),
279
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 97:").WithArguments("a").WithLocation(38, 13)
284
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 1:").WithArguments("1").WithLocation(11, 13),
287
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 97:").WithArguments("97").WithLocation(23, 13),
296
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 97.0f:").WithArguments("a").WithLocation(34, 13),
299
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 'a':").WithArguments("a").WithLocation(36, 13),
305
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 97:").WithArguments("a").WithLocation(38, 13)
334
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "default:").WithArguments("default").WithLocation(15, 13)
339
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "default:").WithArguments("default").WithLocation(15, 13)
371
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "default:").WithArguments("default").WithLocation(15, 13)
1049
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 0:").WithArguments("0").WithLocation(12, 13)
1060
Diagnostic(ErrorCode.
ERR_DuplicateCaseLabel
, "case 0:").WithArguments("0").WithLocation(12, 13)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\EnumTests.cs (1)
427
DiagnosticsUtils.VerifyErrorCodesNoLineColumn(comp.GetDiagnostics(), new ErrorDescription { Code = (int)ErrorCode.
ERR_DuplicateCaseLabel
});