364 references to HDN_RedundantPattern
Microsoft.CodeAnalysis.CSharp (3)
Binder\DecisionDagBuilder_CheckOrReachability.cs (1)
211
ErrorCode errorCode = shouldWarn(node) ? ErrorCode.WRN_RedundantPattern : ErrorCode.
HDN_RedundantPattern
;
Errors\ErrorFacts.cs (1)
2549
or ErrorCode.
HDN_RedundantPattern
Generated\ErrorFacts.Generated.cs (1)
392
case ErrorCode.
HDN_RedundantPattern
:
Microsoft.CodeAnalysis.CSharp.CSharp15.UnitTests (31)
UnionsTests.cs (31)
5469
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C2").WithLocation(100, 25),
5481
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C2").WithLocation(200, 25),
5715
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C2 {}").WithLocation(200, 25),
5727
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C2 {}").WithLocation(300, 25),
5785
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C2").WithLocation(1000, 28),
5794
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C2").WithLocation(2000, 28),
5915
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C2").WithLocation(900, 27),
5924
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C2").WithLocation(950, 27),
7604
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(100, 50),
7607
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string").WithLocation(200, 48),
7610
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string").WithLocation(300, 48),
7635
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(1200, 42),
7638
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(1300, 42),
7641
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(1400, 37)
7762
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(100, 50),
7765
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string").WithLocation(200, 48),
7768
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string").WithLocation(300, 48),
7826
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(100, 42),
7829
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(200, 42)
7887
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(100, 63),
7972
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(26, 50),
8117
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(17, 46)
8169
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(23, 55),
8175
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C2").WithLocation(33, 57)
8326
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(100, 40),
8329
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "object").WithLocation(300, 38),
8463
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(1000, 42),
8466
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(1100, 42),
8469
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(1200, 37)
14158
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "I1").WithLocation(300, 25),
15527
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(26, 42)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
CodeGen\CodeGenTupleTest.cs (4)
28535
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "false").WithLocation(10, 40),
28538
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(11, 23),
28541
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(12, 23),
28544
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "false").WithLocation(12, 39));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (310)
FlowAnalysis\FlowTests.cs (5)
4562
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "true").WithLocation(36, 45),
4568
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "true").WithLocation(44, 46),
4574
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "false").WithLocation(52, 46),
4589
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "false").WithLocation(76, 52),
4896
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(44, 43),
Semantics\PatternMatchingTests.cs (9)
6825
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{}").WithLocation(10, 18),
8881
Diagnostic(ErrorCode.
HDN_RedundantPattern
, @""" """).WithLocation(13, 55),
8884
Diagnostic(ErrorCode.
HDN_RedundantPattern
, @""" """).WithLocation(14, 52),
8887
Diagnostic(ErrorCode.
HDN_RedundantPattern
, @""" "" or """"").WithLocation(14, 52),
8890
Diagnostic(ErrorCode.
HDN_RedundantPattern
, @"""""").WithLocation(15, 50),
10496
Diagnostic(ErrorCode.
HDN_RedundantPattern
, @""" """).WithLocation(15, 55),
10499
Diagnostic(ErrorCode.
HDN_RedundantPattern
, @""" """).WithLocation(16, 52),
10502
Diagnostic(ErrorCode.
HDN_RedundantPattern
, @""" "" or """"").WithLocation(16, 52),
10505
Diagnostic(ErrorCode.
HDN_RedundantPattern
, @"""""").WithLocation(17, 50),
Semantics\PatternMatchingTests_ListPatterns.cs (55)
2642
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "1").WithLocation(8, 27),
2651
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "1").WithLocation(12, 31),
2654
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "2").WithLocation(12, 33),
2657
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "3").WithLocation(12, 35),
2663
Diagnostic(ErrorCode.
HDN_RedundantPattern
, ">=0").WithLocation(14, 31),
2669
Diagnostic(ErrorCode.
HDN_RedundantPattern
, ">=0").WithLocation(16, 28),
2690
Diagnostic(ErrorCode.
HDN_RedundantPattern
, ">= -1").WithLocation(24, 31),
2693
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "> -1").WithLocation(25, 31),
2699
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "<= int.MaxValue - 1").WithLocation(27, 37),
2705
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "< int.MaxValue - 1").WithLocation(29, 37),
2930
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "< bad").WithLocation(11, 31),
2933
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "<= bad").WithLocation(12, 31),
2936
Diagnostic(ErrorCode.
HDN_RedundantPattern
, ">= bad").WithLocation(13, 31),
2939
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "> bad").WithLocation(14, 31),
3732
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{}").WithLocation(8, 26));
5091
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(9, 10),
5094
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0 or > 1").WithLocation(10, 15),
5100
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(16, 10),
5103
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0 or > 1").WithLocation(17, 15),
5112
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(39, 14),
5121
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0 or > 1").WithLocation(61, 15),
5203
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(17, 21),
5342
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(17, 18),
5345
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(24, 18),
5360
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[_, _]").WithLocation(55, 20),
5372
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "1").WithLocation(79, 27)
5902
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "> 2").WithLocation(29, 14)
5948
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "> 2").WithLocation(29, 14)
5992
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0").WithLocation(20, 6)
6041
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(14, 6),
6044
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0 or > 1").WithLocation(15, 14),
6050
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(27, 6),
6053
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0 or > 1").WithLocation(28, 14)
6194
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "< 0").WithLocation(5, 6),
6197
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0 or > 1").WithLocation(6, 14));
6221
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "< 0").WithLocation(5, 9),
6224
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0 or > 1").WithLocation(6, 14));
6992
Diagnostic(ErrorCode.
HDN_RedundantPattern
, ">=0").WithLocation(11, 20));
7211
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "I1").WithLocation(126, 27),
7214
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "I1").WithLocation(126, 48),
7478
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "<0").WithLocation(10, 27),
7481
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0 or >1").WithLocation(10, 44),
7484
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "<0").WithLocation(15, 34),
7487
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "<0").WithLocation(20, 27),
7490
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0 or >1").WithLocation(21, 23),
7493
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int.MaxValue").WithLocation(31, 70),
7496
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "<= int.MaxValue - 1").WithLocation(36, 26),
7499
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "<= int.MaxValue - 2").WithLocation(41, 29),
7502
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0 or 1").WithLocation(41, 68),
7505
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0").WithLocation(50, 18),
7508
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0").WithLocation(50, 23));
7541
Diagnostic(ErrorCode.
HDN_RedundantPattern
, ">=1").WithLocation(20, 23));
7622
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "-1").WithLocation(4, 20),
7625
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ Length: -1 }").WithLocation(5, 10),
7664
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ Length: -1 }").WithLocation(3, 18),
Semantics\PatternMatchingTests2.cs (6)
166
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "3").WithLocation(12, 38),
172
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "3").WithLocation(14, 39),
204
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "3").WithLocation(9, 38),
207
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "3").WithLocation(10, 39)
302
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "false").WithLocation(10, 19));
310
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "false").WithLocation(10, 26));
Semantics\PatternMatchingTests3.cs (2)
7419
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "true").WithLocation(11, 18),
7422
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(12, 10)
Semantics\PatternMatchingTests4.cs (231)
4488
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "< 10.0").WithLocation(10, 22),
4491
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "< 0").WithLocation(11, 26));
4577
Diagnostic(ErrorCode.
HDN_RedundantPattern
, ">= -40.0").WithLocation(11, 13),
4580
Diagnostic(ErrorCode.
HDN_RedundantPattern
, ">= 0").WithLocation(12, 13));
4903
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "B").WithLocation(5, 21),
5007
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "Derived").WithLocation(4, 20),
5010
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "Derived").WithLocation(7, 15),
5135
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string").WithLocation(4, 24),
5138
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string").WithLocation(5, 31),
5180
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ Length: >0 }").WithLocation(4, 23),
5183
Diagnostic(ErrorCode.
HDN_RedundantPattern
, ">0").WithLocation(4, 33),
5186
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ Length: >0 }").WithLocation(5, 24),
5189
Diagnostic(ErrorCode.
HDN_RedundantPattern
, ">0").WithLocation(5, 34),
5192
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ Length: >0 }").WithLocation(7, 23),
5195
Diagnostic(ErrorCode.
HDN_RedundantPattern
, ">0").WithLocation(7, 33),
5532
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(3, 26),
5535
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(3, 41),
5538
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(4, 26),
5541
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 40),
5650
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0").WithLocation(4, 24),
5689
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "false").WithLocation(4, 24),
5695
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "true").WithLocation(6, 24),
5757
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[]").WithLocation(4, 24),
5972
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string").WithLocation(2, 20),
6045
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int").WithLocation(5, 29),
6048
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int").WithLocation(6, 34),
6060
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "Derived").WithLocation(11, 24),
6147
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(8, 53),
6153
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "46").WithLocation(8, 96),
6279
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(2, 28),
6282
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(2, 43),
6309
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(2, 36),
6312
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(2, 58),
6339
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(2, 34),
6342
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(2, 56),
6408
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(3, 22),
6411
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(4, 27),
6414
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(5, 21),
6426
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S { }").WithLocation(9, 22),
6478
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(3, 18),
6481
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2 { }").WithLocation(4, 18));
6525
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int").WithLocation(18, 27));
6565
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(3, 26),
6568
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ Prop: _ }").WithLocation(5, 26),
6571
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "(_, _)").WithLocation(7, 26),
6574
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C { }").WithLocation(11, 26),
6577
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C { Prop: _ }").WithLocation(13, 26),
6580
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C (_, _)").WithLocation(15, 26));
6620
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(3, 25),
6623
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ Prop: _ }").WithLocation(5, 25),
6626
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "(_, _)").WithLocation(7, 25),
6629
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C { }").WithLocation(11, 25),
6632
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C { Prop: _ }").WithLocation(13, 25),
6635
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C (_, _)").WithLocation(15, 25));
6676
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(2, 17),
6679
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ Prop: _ }").WithLocation(4, 17),
6682
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "(_, _)").WithLocation(6, 17),
6685
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2 { }").WithLocation(10, 17),
6688
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2 { Prop: _ }").WithLocation(12, 17),
6691
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2 (_, _)").WithLocation(14, 17),
6694
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int").WithLocation(18, 28));
6734
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(3, 18),
6737
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(3, 26),
6740
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(4, 18),
6743
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(5, 18),
6746
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ Prop: _ }").WithLocation(5, 26),
6749
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(6, 18),
6752
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(7, 18),
6755
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "(_, _)").WithLocation(7, 26),
6758
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(8, 18),
6761
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(9, 18),
6764
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(11, 18),
6767
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2 { }").WithLocation(11, 26),
6770
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(12, 18),
6773
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(13, 18),
6776
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2 { Prop: _ }").WithLocation(13, 26),
6779
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(14, 18),
6782
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(15, 18),
6785
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2 (_, _)").WithLocation(15, 26),
6788
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(16, 18),
6791
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(17, 18));
6831
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(3, 19),
6834
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(3, 26),
6837
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(4, 19),
6840
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(5, 19),
6843
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ Prop: _ }").WithLocation(5, 26),
6846
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(6, 19),
6849
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(7, 19),
6852
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "(_, _)").WithLocation(7, 26),
6855
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(8, 19),
6858
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(9, 19),
6861
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(11, 19),
6864
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2 { }").WithLocation(11, 26),
6867
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(12, 19),
6870
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(13, 19),
6873
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2 { Prop: _ }").WithLocation(13, 26),
6876
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(14, 19),
6879
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(15, 19),
6882
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2 (_, _)").WithLocation(15, 26),
6885
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(16, 19),
6888
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "S2").WithLocation(17, 19));
6987
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[..]").WithLocation(2, 24),
6990
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[.._]").WithLocation(3, 24),
7035
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[..]").WithLocation(2, 25),
7038
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[.._]").WithLocation(3, 25),
7041
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[_, ..]").WithLocation(6, 25),
7044
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[_, .._]").WithLocation(7, 25));
7077
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[..]").WithLocation(2, 17),
7080
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[.._]").WithLocation(3, 17));
7113
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[..]").WithLocation(2, 24),
7116
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[.._]").WithLocation(3, 24),
7161
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[..]").WithLocation(2, 25),
7164
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[.._]").WithLocation(3, 25),
7167
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[_, ..]").WithLocation(6, 25),
7170
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "[_, .._]").WithLocation(7, 25));
7211
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "(_, _)").WithLocation(10, 21),
7220
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "(_, _)").WithLocation(13, 28),
7223
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "(_, _)").WithLocation(14, 33),
7297
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(4, 28),
7300
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 36),
7340
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int").WithLocation(2, 17),
7343
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int").WithLocation(2, 22),
7346
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int").WithLocation(6, 17),
7349
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int").WithLocation(6, 22),
7352
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int").WithLocation(9, 11),
7355
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int").WithLocation(9, 16),
7384
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(2, 26),
7387
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(2, 41),
7413
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(2, 34),
7416
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(2, 59),
7512
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(2, 22),
7515
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(2, 37),
7518
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 17),
7521
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(5, 32),
7524
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(11, 22),
7527
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(11, 37));
7554
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(2, 22),
7557
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(2, 37),
7560
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 17),
7563
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(5, 32),
7566
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(11, 22),
7569
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(11, 37));
7602
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(3, 22),
7605
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(3, 37),
7608
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(6, 17),
7611
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(6, 32),
7614
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(12, 22),
7617
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(12, 37));
7651
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(3, 30),
7654
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(3, 52),
7657
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(6, 25),
7660
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(6, 47),
7663
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(12, 30),
7666
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(12, 52));
7693
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(2, 26),
7696
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(2, 41),
7705
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 26),
7708
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(5, 45),
7749
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(2, 26),
7755
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(4, 26),
7758
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "_ or _").WithLocation(4, 33),
7761
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "_").WithLocation(4, 38),
7764
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 26),
7767
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(7, 26),
7773
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(10, 36),
7779
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(13, 26),
7782
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "var z or var t").WithLocation(13, 32),
7819
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(3, 29),
7825
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 29),
7828
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(6, 29),
7831
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(8, 29),
7837
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(11, 29),
7880
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(2, 26),
7886
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 26),
7892
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(8, 34),
7898
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(11, 26),
7904
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(14, 26),
7919
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(21, 26),
7922
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "int").WithLocation(21, 30));
7947
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(2, 26),
7950
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(2, 46),
7959
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 26),
7962
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(5, 50),
8011
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(3, 31),
8023
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(7, 39),
8032
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(10, 53),
8038
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(11, 54));
8075
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 26),
8078
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(5, 51),
8162
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "1").WithLocation(2, 20),
8168
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "1").WithLocation(5, 25),
8267
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 38),
8270
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(5, 66),
8294
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(11, 30),
8297
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(11, 45),
8306
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "(_, _)").WithLocation(13, 40),
8321
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(17, 30),
8324
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(17, 45),
8339
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(21, 30),
8342
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(21, 45),
8398
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(5, 38),
8401
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(5, 66),
8425
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(11, 30),
8428
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(11, 45),
8437
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "(_, _)").WithLocation(13, 40),
8452
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(17, 30),
8455
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "45").WithLocation(17, 45),
8624
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0").WithLocation(4, 28),
8639
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0").WithLocation(8, 36),
8657
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "0").WithLocation(14, 32),
8660
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "42").WithLocation(15, 17),
8663
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(16, 22));
8687
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ Prop1: 43 }").WithLocation(3, 31),
8690
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "43").WithLocation(4, 30)
8878
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ P2: 2 }").WithLocation(5, 64),
8881
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ P2: 2 }").WithLocation(7, 49)
8949
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string or null").WithLocation(2, 15),
8955
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string or null").WithLocation(7, 15),
8964
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string or null").WithLocation(13, 17),
8967
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string or null").WithLocation(14, 17));
8991
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{F: 1 and not 1} and {O: not A or B}").WithLocation(3, 12),
8994
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "not A or B").WithLocation(3, 37),
8997
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "A").WithLocation(3, 41),
9109
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string").WithLocation(2, 23),
9115
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "string").WithLocation(3, 23),
9127
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "Derived").WithLocation(21, 23),
9145
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "object").WithLocation(37, 23),
9148
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "Base").WithLocation(38, 23),
9151
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "object").WithLocation(41, 23),
9154
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "Base").WithLocation(42, 23));
9261
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "not null or (C and ({ Prop1: 0 } or { Prop2: 1 }))").WithLocation(3, 30),
Semantics\PatternMatchingTests5.cs (2)
1922
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "false").WithLocation(10, 18),
4872
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "I1").WithLocation(49, 30)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (16)
Semantics\NullableReferenceTypesTests.cs (11)
27077
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "true").WithLocation(18, 26)
27146
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(17, 39));
27180
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(16, 34));
27524
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(12, 28),
27589
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "null").WithLocation(14, 33),
27632
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "bool").WithLocation(15, 26),
27702
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "true").WithLocation(18, 50),
52076
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(38, 39),
52611
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "true").WithLocation(38, 39),
52620
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "true").WithLocation(45, 38),
159318
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{ }").WithLocation(15, 21),
Semantics\NullableReferenceTypesVsPatterns.cs (5)
1323
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{}").WithLocation(10, 20),
1326
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{}").WithLocation(11, 14),
1329
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{}").WithLocation(12, 14),
1332
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "{}").WithLocation(12, 18),
2734
Diagnostic(ErrorCode.
HDN_RedundantPattern
, "C").WithLocation(36, 17),