93 references to ERR_AssignReadonlyNotField
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder.ValueChecks.cs (1)
3385
ErrorCode.
ERR_AssignReadonlyNotField
,
Errors\ErrorFacts.cs (1)
1848
or ErrorCode.
ERR_AssignReadonlyNotField
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (12)
CodeGen\CodeGenInParametersTests.cs (3)
1161
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "arg1").WithArguments("variable", "arg1").WithLocation(6, 9),
1167
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "arg1").WithArguments("variable", "arg1").WithLocation(9, 9),
1173
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)
2939
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "p").WithArguments("variable", "p").WithLocation(5, 17),
2942
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "p").WithArguments("variable", "p").WithLocation(7, 19),
2948
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "p").WithArguments("variable", "p").WithLocation(20, 17),
2992
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "y").WithArguments("variable", "y").WithLocation(5, 17),
2995
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "y").WithArguments("variable", "y").WithLocation(10, 17));
3061
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "y").WithArguments("variable", "y").WithLocation(9, 25),
3064
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "y").WithArguments("variable", "y").WithLocation(14, 43));
Semantics\ExtensionTests.cs (1)
19007
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "object.Property").WithArguments("property", "Property").WithLocation(1, 1));
Semantics\InlineArrayTests.cs (7)
9954
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.F[0]").WithArguments("method", "this.get").WithLocation(18, 9)
9983
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F[0]").WithArguments("method", "this.get").WithLocation(15, 9)
10435
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.F[..][0]").WithArguments("property", "this").WithLocation(18, 9)
10464
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F[..][0]").WithArguments("property", "this").WithLocation(15, 9)
10842
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.F[0]").WithArguments("method", "this.get").WithLocation(24, 9)
11098
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.F[0][0]").WithArguments("method", "this.get").WithLocation(24, 9)
11441
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "c.F[..][0]").WithArguments("property", "this").WithLocation(24, 9)
Semantics\PrimaryConstructorTests.cs (1)
14807
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "x").WithArguments("variable", "x").WithLocation(7, 9),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (63)
Semantics\ForEachTests.cs (1)
3806
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "items").WithArguments("method", "Current.get").WithLocation(4, 21)
Semantics\NullableReferenceTypesTests.cs (2)
18967
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "xIn").WithArguments("variable", "xIn").WithLocation(6, 9));
131075
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)
6042
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(7, 9),
6048
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(8, 9),
6051
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(9, 9),
6054
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(10, 9),
6057
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(16, 13),
6060
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(17, 13),
6063
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(18, 13));
6139
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(7, 9),
6145
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(8, 9),
6148
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(9, 9),
6151
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(10, 9),
6154
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(16, 13),
6157
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(17, 13),
6160
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "F").WithArguments("field", "F").WithLocation(18, 13));
6200
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(10, 17),
6206
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "GetRefReadonly()").WithArguments("method", "GetRefReadonly").WithLocation(18, 21));
6286
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(10, 17),
6292
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "GetRefReadonly()").WithArguments("method", "GetRefReadonly").WithLocation(18, 21));
6692
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(9, 59),
6695
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(10, 59),
6698
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(11, 75),
6701
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(12, 59),
6704
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(14, 64),
6707
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(15, 64),
6710
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(16, 80),
6713
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(17, 64),
6716
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(19, 80),
6719
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(20, 80),
6722
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(21, 96),
6725
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(22, 80),
6728
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(24, 61),
6731
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(25, 61),
6734
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(26, 77),
6737
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(27, 61));
7097
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(9, 59),
7100
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(10, 59),
7103
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(11, 75),
7106
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "s.F").WithArguments("field", "F").WithLocation(12, 59),
7109
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(14, 64),
7112
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(15, 64),
7115
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(16, 80),
7118
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sRef.F").WithArguments("field", "F").WithLocation(17, 64),
7121
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(19, 80),
7124
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(20, 80),
7127
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(21, 96),
7130
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sOut.F").WithArguments("field", "F").WithLocation(22, 80),
7133
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(24, 61),
7136
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(25, 61),
7139
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(26, 77),
7142
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "sIn.F").WithArguments("field", "F").WithLocation(27, 61));
7190
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(12, 69),
7202
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(17, 77),
7211
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "tIn").WithArguments("variable", "tIn").WithLocation(22, 93),
20700
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "Value()").WithArguments("method", "Value").WithLocation(8, 39)
20731
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "i").WithArguments("variable", "i").WithLocation(7, 31)
31158
Diagnostic(ErrorCode.
ERR_AssignReadonlyNotField
, "ri").WithArguments("field", "ri").WithLocation(4, 20),
Semantics\RefLocalsAndReturnsTests.cs (1)
506
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));