100 references to ERR_RefAssignNarrower
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Statements.cs (1)
1567
(_, false) => ErrorCode.
ERR_RefAssignNarrower
,
Errors\ErrorFacts.cs (1)
1824
case ErrorCode.
ERR_RefAssignNarrower
:
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (98)
Semantics\RefEscapingTests.cs (3)
1489
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "_ = ref y4").WithArguments("_", "y4").WithLocation(25, 9));
5161
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "obj = ref this").WithArguments("obj", "this").WithLocation(7, 9),
5217
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "obj = ref this").WithArguments("obj", "this").WithLocation(7, 9),
Semantics\RefFieldTests.cs (84)
2597
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r2.F = ref t").WithArguments("F", "t").WithLocation(18, 9)
2610
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r2.F = ref t").WithArguments("F", "t").WithLocation(18, 9)
2699
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r.Field = ref i").WithArguments("Field", "i").WithLocation(10, 9)
4394
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r.RB = ref r.B").WithArguments("RB", "r.B").WithLocation(17, 9));
5503
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F1 = ref t").WithArguments("F1", "t").WithLocation(10, 9),
5506
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F2 = ref t").WithArguments("F2", "t").WithLocation(11, 9),
5509
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F3 = ref t").WithArguments("F3", "t").WithLocation(12, 9),
5512
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F4 = ref t").WithArguments("F4", "t").WithLocation(13, 9),
5515
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "x.F1 = ref t").WithArguments("F1", "t").WithLocation(21, 9),
5518
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "x.F2 = ref t").WithArguments("F2", "t").WithLocation(22, 9),
5527
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "y.F1 = ref t").WithArguments("F1", "t").WithLocation(26, 9),
5530
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "y.F2 = ref t").WithArguments("F2", "t").WithLocation(27, 9),
5740
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref tValue").WithArguments("F", "tValue").WithLocation(7, 9),
5743
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref tOut").WithArguments("F", "tOut").WithLocation(9, 9),
5749
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref value").WithArguments("F", "value").WithLocation(16, 13),
5786
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref tValue").WithArguments("F", "tValue").WithLocation(7, 9),
5789
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref tOut").WithArguments("F", "tOut").WithLocation(9, 9),
5792
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref value").WithArguments("F", "value").WithLocation(16, 13));
5826
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref tValue").WithArguments("F", "tValue").WithLocation(7, 9),
5829
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref tOut").WithArguments("F", "tOut").WithLocation(9, 9),
5835
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref value").WithArguments("F", "value").WithLocation(16, 13),
5872
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref tValue").WithArguments("F", "tValue").WithLocation(7, 9),
5875
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref tOut").WithArguments("F", "tOut").WithLocation(9, 9),
5878
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "F = ref value").WithArguments("F", "value").WithLocation(16, 13));
6727
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s.F = ref tValue").WithArguments("F", "tValue").WithLocation(9, 59),
6733
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s.F = ref tOut").WithArguments("F", "tOut").WithLocation(11, 75),
6739
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "sRef.F = ref tValue").WithArguments("F", "tValue").WithLocation(14, 64),
6745
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "sRef.F = ref tOut").WithArguments("F", "tOut").WithLocation(16, 80),
6751
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "sOut.F = ref tValue").WithArguments("F", "tValue").WithLocation(19, 80),
6754
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "sOut.F = ref tOut").WithArguments("F", "tOut").WithLocation(21, 96),
6850
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s.F = ref tValue").WithArguments("F", "tValue").WithLocation(9, 59),
6856
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s.F = ref tOut").WithArguments("F", "tOut").WithLocation(11, 75),
6862
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "sRef.F = ref tValue").WithArguments("F", "tValue").WithLocation(14, 64),
6868
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "sRef.F = ref tOut").WithArguments("F", "tOut").WithLocation(16, 80),
6874
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "sOut.F = ref tValue").WithArguments("F", "tValue").WithLocation(19, 80),
6877
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "sOut.F = ref tOut").WithArguments("F", "tOut").WithLocation(21, 96),
13471
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r0 = ref r1").WithArguments("r0", "r1").WithLocation(9, 13),
13474
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r0 = ref r2").WithArguments("r0", "r2").WithLocation(13, 13));
13511
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r0 = ref r1").WithArguments("r0", "r1").WithLocation(8, 13),
13514
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r0 = ref r2").WithArguments("r0", "r2").WithLocation(12, 13));
13550
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r0 = ref r1").WithArguments("r0", "r1").WithLocation(9, 13),
13553
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r0 = ref r2").WithArguments("r0", "r2").WithLocation(12, 13)
14848
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r0 = ref r1").WithArguments("r0", "r1").WithLocation(8, 13),
14851
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r0 = ref r2").WithArguments("r0", "r2").WithLocation(12, 13),
14854
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r0 = ref r5").WithArguments("r0", "r5").WithLocation(24, 13),
18868
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r3.F = ref t").WithArguments("F", "t").WithLocation(29, 9),
18871
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r7.F = ref t").WithArguments("F", "t").WithLocation(59, 9)
18946
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r3.F = ref t").WithArguments("F", "t").WithLocation(26, 9),
18949
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r7.F = ref t").WithArguments("F", "t").WithLocation(52, 9));
19037
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r3.F = ref t").WithArguments("F", "t").WithLocation(29, 9),
19049
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r7.F = ref t").WithArguments("F", "t").WithLocation(59, 9),
19132
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r3.F = ref t").WithArguments("F", "t").WithLocation(26, 9),
19144
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r7.F = ref t").WithArguments("F", "t").WithLocation(52, 9),
19255
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "this.F = ref t2").WithArguments("F", "t2").WithLocation(18, 9),
19264
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "this.F = ref t4").WithArguments("F", "t4").WithLocation(31, 9));
19311
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "this.F = ref t2").WithArguments("F", "t2").WithLocation(16, 9),
19320
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "this.F = ref t4").WithArguments("F", "t4").WithLocation(27, 9));
19436
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r.F = ref t").WithArguments("F", "t").WithLocation(12, 13));
22077
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "value.F = ref this").WithArguments("F", "this").WithLocation(11, 15),
22113
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "value.F = ref this").WithArguments("F", "this").WithLocation(11, 16),
22119
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "value.F = ref this").WithArguments("F", "this").WithLocation(20, 16));
22403
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r.F = ref this").WithArguments("F", "this").WithLocation(10, 9),
22409
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r.F = ref this").WithArguments("F", "this").WithLocation(18, 9));
22416
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r.F = ref this").WithArguments("F", "this").WithLocation(10, 9),
22425
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r.F = ref this").WithArguments("F", "this").WithLocation(18, 9));
23552
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "_i = ref i3").WithArguments("_i", "i3").WithLocation(16, 9),
27232
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "p2.refField = ref p1.field").WithArguments("refField", "p1.field").WithLocation(7, 5),
27235
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "p2.refField = ref p1.field").WithArguments("refField", "p1.field").WithLocation(13, 5),
27238
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "p2.refField = ref p1.field").WithArguments("refField", "p1.field").WithLocation(19, 5),
27428
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "p.refField = ref this.field").WithArguments("refField", "this.field").WithLocation(13, 9),
27569
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "p3.refField = ref p1.field").WithArguments("refField", "p1.field").WithLocation(9, 9));
28435
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s1.RefField = ref value").WithArguments("RefField", "value").WithLocation(8, 9),
28438
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s1.RefProperty.RefField = ref value").WithArguments("RefField", "value").WithLocation(14, 9),
28441
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s1.RefMethod().RefField = ref value").WithArguments("RefField", "value").WithLocation(20, 9));
28512
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s1.RefField = ref value").WithArguments("RefField", "value").WithLocation(7, 9),
28515
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s1.RefProperty.RefField = ref value").WithArguments("RefField", "value").WithLocation(12, 9),
28518
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s1.RefMethod().RefField = ref value").WithArguments("RefField", "value").WithLocation(17, 9),
28524
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s1.RefProperty.RefField = ref value").WithArguments("RefField", "value").WithLocation(27, 9),
28527
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s1.RefMethod().RefField = ref value").WithArguments("RefField", "value").WithLocation(32, 9),
28533
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s1.RefProperty.RefField = ref value").WithArguments("RefField", "value").WithLocation(42, 9),
28536
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s1.RefMethod().RefField = ref value").WithArguments("RefField", "value").WithLocation(47, 9));
28790
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "GetReference1(ref s1).RefField = ref value").WithArguments("RefField", "value").WithLocation(8, 9),
28793
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "GetReference2(in s1).RefField = ref value").WithArguments("RefField", "value").WithLocation(9, 9),
28796
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "GetReference3(out s1).RefField = ref value").WithArguments("RefField", "value").WithLocation(10, 9),
Semantics\RefLocalsAndReturnsTests.cs (11)
64
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r1 = ref rx").WithArguments("r1", "rx").WithLocation(8, 30),
67
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "r1 = ref rx").WithArguments("r1", "rx").WithLocation(11, 33));
140
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "rd = ref rd.Length").WithArguments("rd", "rd.Length").WithLocation(7, 9));
177
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s = ref this").WithArguments("s", "this").WithLocation(6, 9),
589
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s = ref s2").WithArguments("s", "s2").WithLocation(8, 9),
595
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s = ref s3").WithArguments("s", "s3").WithLocation(13, 9));
613
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "s = ref s2").WithArguments("s", "s2").WithLocation(7, 9));
718
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "rx = ref y").WithArguments("rx", "y").WithLocation(9, 9));
785
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "x = ref y").WithArguments("x", "y").WithLocation(8, 9),
815
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "x = ref y").WithArguments("x", "y").WithLocation(7, 9),
818
Diagnostic(ErrorCode.
ERR_RefAssignNarrower
, "x = ref z").WithArguments("x", "z").WithLocation(10, 9));