93 references to ERR_AssignReadonlyNotField
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder.ValueChecks.cs (1)
3676
ErrorCode.
ERR_AssignReadonlyNotField
,
Errors\ErrorFacts.cs (1)
1855
or ErrorCode.
ERR_AssignReadonlyNotField
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (12)
CodeGen\CodeGenInParametersTests.cs (3)
1164
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "arg1").WithArguments("variable", "arg1").WithLocation(6, 9),
1170
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "arg1").WithArguments("variable", "arg1").WithLocation(9, 9),
1176
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.Emit3.UnitTests (16)
RefReadonlyParameterTests.cs (7)
2948
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "p").WithArguments("variable", "p").WithLocation(5, 17),
2951
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "p").WithArguments("variable", "p").WithLocation(7, 19),
2957
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "p").WithArguments("variable", "p").WithLocation(20, 17),
3001
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "y").WithArguments("variable", "y").WithLocation(5, 17),
3004
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "y").WithArguments("variable", "y").WithLocation(10, 17));
3070
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "y").WithArguments("variable", "y").WithLocation(9, 25),
3073
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "y").WithArguments("variable", "y").WithLocation(14, 43));
Semantics\ExtensionTests.cs (1)
20539
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "object.Property").WithArguments("property", "Property").WithLocation(1, 1));
Semantics\InlineArrayTests.cs (7)
10005
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.F[0]").WithArguments("method", "this.get").WithLocation(18, 9)
10034
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F[0]").WithArguments("method", "this.get").WithLocation(15, 9)
10486
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.F[..][0]").WithArguments("property", "this").WithLocation(18, 9)
10515
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F[..][0]").WithArguments("property", "this").WithLocation(15, 9)
10893
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.F[0]").WithArguments("method", "this.get").WithLocation(24, 9)
11149
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.F[0][0]").WithArguments("method", "this.get").WithLocation(24, 9)
11492
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.F[..][0]").WithArguments("property", "this").WithLocation(24, 9)
Semantics\PrimaryConstructorTests.cs (1)
14947
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "x").WithArguments("variable", "x").WithLocation(7, 9),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (63)
Semantics\ForEachTests.cs (1)
4322
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "items").WithArguments("method", "Current.get").WithLocation(4, 21)
Semantics\NullableReferenceTypesTests.cs (2)
18971
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "xIn").WithArguments("variable", "xIn").WithLocation(6, 9));
131147
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s").WithArguments("variable", "s").WithLocation(18, 9),
Semantics\RefExtensionMethodsTests.cs (1)
1501
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "p").WithArguments("variable", "p").WithLocation(6, 9));
Semantics\RefFieldTests.cs (56)
6114
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(7, 9),
6120
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(8, 9),
6123
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(9, 9),
6126
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(10, 9),
6129
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(16, 13),
6132
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(17, 13),
6135
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(18, 13));
6211
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(7, 9),
6217
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(8, 9),
6220
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(9, 9),
6223
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(10, 9),
6226
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(16, 13),
6229
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(17, 13),
6232
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(18, 13));
6272
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(10, 17),
6278
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "GetRefReadonly()").WithArguments("method", "GetRefReadonly").WithLocation(18, 21));
6358
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(10, 17),
6364
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "GetRefReadonly()").WithArguments("method", "GetRefReadonly").WithLocation(18, 21));
6764
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(9, 59),
6767
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(10, 59),
6770
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(11, 75),
6773
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(12, 59),
6776
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(14, 64),
6779
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(15, 64),
6782
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(16, 80),
6785
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(17, 64),
6788
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(19, 80),
6791
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(20, 80),
6794
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(21, 96),
6797
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(22, 80),
6800
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(24, 61),
6803
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(25, 61),
6806
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(26, 77),
6809
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(27, 61));
7169
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(9, 59),
7172
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(10, 59),
7175
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(11, 75),
7178
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(12, 59),
7181
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(14, 64),
7184
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(15, 64),
7187
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(16, 80),
7190
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(17, 64),
7193
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(19, 80),
7196
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(20, 80),
7199
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(21, 96),
7202
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(22, 80),
7205
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(24, 61),
7208
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(25, 61),
7211
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(26, 77),
7214
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(27, 61));
7262
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(12, 69),
7274
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(17, 77),
7283
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(22, 93),
20734
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "Value()").WithArguments("method", "Value").WithLocation(8, 39)
20765
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "i").WithArguments("variable", "i").WithLocation(7, 31)
31384
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "ri").WithArguments("field", "ri").WithLocation(4, 20),
Semantics\RefLocalsAndReturnsTests.cs (1)
503
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "new RefEnumerable()").WithArguments("method", "Current.get").WithLocation(13, 31));
Semantics\SimpleLambdaParametersWithModifiersTests.cs (2)
691
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "x").WithArguments("variable", "x").WithLocation(9, 13));
1412
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "x").WithArguments("variable", "x").WithLocation(9, 13));