75 references to ERR_AssignReadonlyNotField
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder.ValueChecks.cs (1)
2873
ErrorCode.
ERR_AssignReadonlyNotField
,
Errors\ErrorFacts.cs (1)
1788
case ErrorCode.
ERR_AssignReadonlyNotField
:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (12)
CodeGen\CodeGenInParametersTests.cs (3)
1131
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "arg1").WithArguments("variable", "arg1").WithLocation(6, 9),
1137
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "arg1").WithArguments("variable", "arg1").WithLocation(9, 9),
1143
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "arg1").WithArguments("variable", "arg1").WithLocation(12, 9),
CodeGen\CodeGenNullCoalescingAssignmentTests.cs (3)
968
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.P1").WithArguments("property", "P1").WithLocation(24, 27),
971
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.GetF1()").WithArguments("method", "GetF1").WithLocation(26, 27)
2602
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "o1").WithArguments("variable", "o1").WithLocation(6, 9),
CodeGen\CodeGenRefReadonlyReturnTests.cs (6)
546
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "M()").WithArguments("method", "M").WithLocation(6, 9),
552
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "M()").WithArguments("method", "M").WithLocation(9, 9),
558
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "M()").WithArguments("method", "M").WithLocation(12, 9),
592
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "P").WithArguments("property", "P").WithLocation(6, 9),
598
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "P").WithArguments("property", "P").WithLocation(9, 9),
604
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "P").WithArguments("property", "P").WithLocation(12, 9),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (61)
Semantics\ForEachTests.cs (1)
3759
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "items").WithArguments("method", "Current.get").WithLocation(4, 21)
Semantics\NullableReferenceTypesTests.cs (2)
18928
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "xIn").WithArguments("variable", "xIn").WithLocation(6, 9));
127305
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s").WithArguments("variable", "s").WithLocation(18, 9),
Semantics\PrimaryConstructorTests.cs (1)
13789
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "x").WithArguments("variable", "x").WithLocation(7, 9),
Semantics\RefExtensionMethodsTests.cs (1)
1501
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "p").WithArguments("variable", "p").WithLocation(6, 9));
Semantics\RefFieldTests.cs (55)
5603
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(7, 9),
5606
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(8, 9),
5609
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(9, 9),
5612
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(10, 9),
5615
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(16, 13),
5618
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(17, 13),
5621
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(18, 13));
5688
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(7, 9),
5691
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(8, 9),
5694
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(9, 9),
5697
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(10, 9),
5700
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(16, 13),
5703
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(17, 13),
5706
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(18, 13));
5746
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(10, 17),
5752
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "GetRefReadonly()").WithArguments("method", "GetRefReadonly").WithLocation(18, 21));
5832
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(10, 17),
5838
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "GetRefReadonly()").WithArguments("method", "GetRefReadonly").WithLocation(18, 21));
6238
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(9, 59),
6241
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(10, 59),
6244
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(11, 75),
6247
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(12, 59),
6250
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(14, 64),
6253
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(15, 64),
6256
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(16, 80),
6259
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(17, 64),
6262
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(19, 80),
6265
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(20, 80),
6268
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(21, 96),
6271
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(22, 80),
6274
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(24, 61),
6277
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(25, 61),
6280
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(26, 77),
6283
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(27, 61));
6643
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(9, 59),
6646
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(10, 59),
6649
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(11, 75),
6652
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(12, 59),
6655
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(14, 64),
6658
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(15, 64),
6661
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(16, 80),
6664
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(17, 64),
6667
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(19, 80),
6670
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(20, 80),
6673
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(21, 96),
6676
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(22, 80),
6679
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(24, 61),
6682
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(25, 61),
6685
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(26, 77),
6688
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(27, 61));
6736
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(12, 69),
6748
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(17, 77),
6757
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(22, 93),
20084
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "Value()").WithArguments("method", "Value").WithLocation(8, 39)
20115
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "i").WithArguments("variable", "i").WithLocation(7, 31)
Semantics\RefLocalsAndReturnsTests.cs (1)
506
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "new RefEnumerable()").WithArguments("method", "Current.get").WithLocation(13, 31));