98 references to ERR_FieldAutoPropCantBeByRefLike
Microsoft.CodeAnalysis.CSharp (3)
Errors\ErrorFacts.cs (1)
1860
or ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
Symbols\Source\SourceMemberFieldSymbol.cs (1)
69
diagnostics.Add(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, getTypeErrorLocation(), type);
Symbols\Source\SourcePropertySymbolBase.cs (1)
1882
diagnostics.Add(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, TypeLocation, type);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (33)
Attributes\AttributeTests_LifetimeAnnotation.cs (1)
184
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(4, 30)
FieldKeywordTests.cs (14)
8165
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(7, 5),
8168
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(8, 5),
8171
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(9, 5),
8174
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(10, 5),
8177
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(11, 5));
8207
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(7, 12),
8210
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(8, 12),
8213
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(9, 12),
8216
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(10, 12),
8219
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(11, 12));
8243
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(7, 12),
8246
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(9, 12),
8249
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(10, 5),
8255
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "R").WithArguments("R").WithLocation(11, 5),
RefStructInterfacesTests.cs (10)
21886
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "T").WithArguments("T").WithLocation(7, 12),
21889
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "S").WithArguments("S").WithLocation(8, 12),
21892
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "T").WithArguments("T").WithLocation(14, 19),
21895
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "S").WithArguments("S").WithLocation(15, 19)
21933
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "T").WithArguments("T").WithLocation(5, 12),
21936
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "S").WithArguments("S").WithLocation(6, 12),
21939
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "T").WithArguments("T").WithLocation(12, 19),
21942
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "S").WithArguments("S").WithLocation(13, 19)
21995
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "T2").WithArguments("T2").WithLocation(6, 5)
22430
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "T").WithArguments("T").WithLocation(3, 5)
Semantics\CollectionExpressionTests.cs (1)
25168
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "ReadOnlySpan<object>").WithArguments("System.ReadOnlySpan<object>").WithLocation(8, 19));
Semantics\InlineArrayTests.cs (1)
2328
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "S").WithArguments("S").WithLocation(5, 13)
Semantics\PrimaryConstructorTests.cs (2)
7112
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(4, 12),
7118
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "ReadOnlySpan<int>").WithArguments("System.ReadOnlySpan<int>").WithLocation(5, 12),
Semantics\RecordTests.cs (4)
1269
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "RefLike").WithArguments("RefLike").WithLocation(15, 5)];
1322
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "RefLike").WithArguments("RefLike").WithLocation(16, 12)];
1378
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "RefLike").WithArguments("RefLike").WithLocation(17, 12)];
1521
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "RefLike").WithArguments("RefLike").WithLocation(15, 19)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (62)
Semantics\RecordStructTests.cs (5)
1536
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "RefLike").WithArguments("RefLike").WithLocation(15, 5)];
1594
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "RefLike").WithArguments("RefLike").WithLocation(15, 5)];
1647
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "RefLike").WithArguments("RefLike").WithLocation(16, 12)];
1703
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "RefLike").WithArguments("RefLike").WithLocation(17, 12)];
1794
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "RefLike").WithArguments("RefLike").WithLocation(15, 19)];
Semantics\RefEscapingTests.cs (6)
8170
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "S").WithArguments("S").WithLocation(8, 20),
8223
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "S").WithArguments("S").WithLocation(8, 20),
8295
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "S").WithArguments("S").WithLocation(8, 20),
8357
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "S").WithArguments("S").WithLocation(8, 20),
8413
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "S").WithArguments("S").WithLocation(8, 20),
8486
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "S").WithArguments("S").WithLocation(8, 20),
Semantics\RefFieldTests.cs (14)
12180
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped R").WithArguments("R").WithLocation(2, 1),
12186
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped var").WithArguments("R").WithLocation(3, 1),
12550
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped R").WithArguments("R").WithLocation(3, 2),
12556
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped ref R").WithArguments("R").WithLocation(4, 2),
12565
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped ref readonly R").WithArguments("R").WithLocation(5, 2),
12604
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped var").WithArguments("R").WithLocation(12, 2),
12610
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped ref var").WithArguments("R").WithLocation(13, 2),
12619
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped ref readonly var").WithArguments("R").WithLocation(14, 2),
12960
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped R").WithArguments("R").WithLocation(3, 8),
12966
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped ref R").WithArguments("R").WithLocation(4, 8),
12975
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped ref readonly R").WithArguments("R").WithLocation(5, 8),
13014
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped var").WithArguments("R").WithLocation(12, 8),
13020
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped ref var").WithArguments("R").WithLocation(13, 8),
13029
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "scoped ref readonly var").WithArguments("R").WithLocation(14, 8),
Semantics\SpanStackSafetyTests.cs (26)
593
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<int>").WithArguments("System.Span<int>").WithLocation(22, 16),
596
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(21, 23),
599
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(10, 19),
602
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<int>").WithArguments("System.Span<int>").WithLocation(11, 12),
605
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(15, 23)
613
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<int>").WithArguments("System.Span<int>").WithLocation(22, 16),
616
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(21, 23),
619
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(10, 19),
622
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<int>").WithArguments("System.Span<int>").WithLocation(11, 12),
625
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(15, 23)
663
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "SpanLike<int>").WithArguments("System.SpanLike<int>").WithLocation(22, 16),
666
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "SpanLike<byte>").WithArguments("System.SpanLike<byte>").WithLocation(21, 23),
669
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "SpanLike<byte>").WithArguments("System.SpanLike<byte>").WithLocation(10, 19),
672
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "SpanLike<int>").WithArguments("System.SpanLike<int>").WithLocation(11, 12),
675
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "SpanLike<byte>").WithArguments("System.SpanLike<byte>").WithLocation(15, 23)
683
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "SpanLike<int>").WithArguments("System.SpanLike<int>").WithLocation(22, 16),
686
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "SpanLike<byte>").WithArguments("System.SpanLike<byte>").WithLocation(21, 23),
689
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "SpanLike<byte>").WithArguments("System.SpanLike<byte>").WithLocation(10, 19),
692
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "SpanLike<int>").WithArguments("System.SpanLike<int>").WithLocation(11, 12),
695
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "SpanLike<byte>").WithArguments("System.SpanLike<byte>").WithLocation(15, 23)
1244
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(17, 19),
1247
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<int>").WithArguments("System.Span<int>").WithLocation(18, 12)
2097
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Point").WithArguments("Point").WithLocation(8, 19),
2100
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Point").WithArguments("Point").WithLocation(7, 12));
2131
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Point").WithArguments("Point").WithLocation(8, 19),
2134
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Point").WithArguments("Point").WithLocation(7, 19));
Semantics\StructConstructorTests.cs (8)
3796
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(4, 12),
3802
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "ReadOnlySpan<int>").WithArguments("System.ReadOnlySpan<int>").WithLocation(5, 12),
3823
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(4, 12),
3829
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "ReadOnlySpan<int>").WithArguments("System.ReadOnlySpan<int>").WithLocation(5, 12),
3850
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(4, 12),
3856
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "ReadOnlySpan<int>").WithArguments("System.ReadOnlySpan<int>").WithLocation(5, 12),
3874
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<byte>").WithArguments("System.Span<byte>").WithLocation(2, 1),
3877
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "ReadOnlySpan<int>").WithArguments("System.ReadOnlySpan<int>").WithLocation(3, 1));
Semantics\UnsafeTests.cs (2)
11267
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "Span<int>").WithArguments("System.Span<int>").WithLocation(3, 1)
11280
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "var").WithArguments("System.Span<int>").WithLocation(2, 1)
Semantics\Utf8StringsLiteralsTests.cs (1)
2545
Diagnostic(ErrorCode.
ERR_FieldAutoPropCantBeByRefLike
, "ReadOnlySpan<byte>").WithArguments("System.ReadOnlySpan<byte>").WithLocation(5, 11),