67 references to ERR_AssignmentInitOnly
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder.ValueChecks.cs (1)
1776
Error(diagnostics, ErrorCode.
ERR_AssignmentInitOnly
, node, propertySymbol);
Errors\ErrorFacts.cs (1)
2108
or ErrorCode.
ERR_AssignmentInitOnly
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
FieldKeywordTests.cs (1)
3937
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "a.P3").WithArguments("A.P3").WithLocation(16, 9),
Semantics\ExtensionTests.cs (1)
19070
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "new object().Property").WithArguments("E.extension(object).Property").WithLocation(1, 1),
Semantics\PrimaryConstructorTests.cs (2)
7998
diagnosticsToCheck.Where(d => d.Code is (int)ErrorCode.
ERR_AssignmentInitOnly
).Any())
8003
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "p1").WithArguments("C1.p1").WithLocation(2000, 1)
Semantics\RecordTests.cs (1)
2583
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "X").WithArguments("R.X").WithLocation(7, 18),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (60)
Semantics\InitOnlyMemberTests.cs (59)
119
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(6, 45),
191
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(6, 9),
498
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(8, 9),
507
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(21, 9)
550
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(8, 9),
556
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(21, 9),
559
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(22, 9),
608
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C<string>.Property").WithLocation(10, 9)
692
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C<string>.Property").WithLocation(12, 13),
695
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C<string>.Property").WithLocation(18, 13),
698
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C<string>.Property").WithLocation(26, 13),
701
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C<string>.Property").WithLocation(32, 13)
749
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C<T>.Property").WithLocation(10, 13),
752
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C<T>.Property").WithLocation(16, 13),
755
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C<T>.Property").WithLocation(26, 17),
758
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C<T>.Property").WithLocation(32, 17)
874
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(8, 9),
877
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(21, 13),
880
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(34, 13),
883
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(39, 13),
889
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(54, 9),
892
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(66, 13),
895
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(79, 13),
898
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(84, 13)
1216
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(9, 9),
1219
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(16, 13),
1222
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(24, 9),
1225
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(31, 13),
1228
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(41, 18)
1255
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(8, 10),
1258
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(8, 21),
1261
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(8, 31)
1312
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(8, 9)
1339
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(8, 9)
1366
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(8, 9)
1393
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(8, 9)
1624
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(8, 9),
1627
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(13, 9),
1630
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(20, 13),
1633
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(25, 13),
1636
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(33, 13),
1639
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c.Property").WithArguments("C.Property").WithLocation(38, 13),
1642
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(51, 9),
1645
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "base.Property").WithArguments("C.Property").WithLocation(52, 9),
1648
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(65, 13),
1651
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "base.Property").WithArguments("C.Property").WithLocation(66, 13),
1654
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(80, 13),
1657
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "base.Property").WithArguments("C.Property").WithLocation(81, 13),
1660
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("C.Property").WithLocation(86, 13),
1663
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "base.Property").WithArguments("C.Property").WithLocation(87, 13)
1691
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "((ISomething)this).Property").WithArguments("ISomething.Property").WithLocation(13, 17)
1719
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "((ISomething)this).Property").WithArguments("ISomething.Property").WithLocation(13, 17)
2615
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "this[43]").WithArguments("C.this[int]").WithLocation(14, 9),
2618
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "this[45]").WithArguments("C.this[int]").WithLocation(25, 9),
2621
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "c2[47]").WithArguments("C.this[int]").WithLocation(33, 9)
4487
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "FirstName").WithArguments("Person.FirstName").WithLocation(7, 16)
4516
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "FirstName").WithArguments("Person.FirstName").WithLocation(10, 24)
4540
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "FirstName").WithArguments("Person.FirstName").WithLocation(7, 19)
4617
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, "Property").WithArguments("ITest28.Property").WithLocation(9, 47)
Semantics\NullConditionalAssignmentTests.cs (1)
801
Diagnostic(ErrorCode.
ERR_AssignmentInitOnly
, ".Prop").WithArguments("C.Prop").WithLocation(2, 3));