37 references to ERR_ArrayElementCantBeRefAny
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Expressions.cs (1)
4136
Error(diagnostics, ErrorCode.
ERR_ArrayElementCantBeRefAny
, node, bestType);
Binder\Binder_Symbols.cs (1)
657
Error(diagnostics, ErrorCode.
ERR_ArrayElementCantBeRefAny
, node.ElementType, type.Type);
Errors\ErrorFacts.cs (1)
990
or ErrorCode.
ERR_ArrayElementCantBeRefAny
Errors\LazyArrayElementCantBeRefAnyDiagnosticInfo.cs (1)
36
return new CSDiagnosticInfo(ErrorCode.
ERR_ArrayElementCantBeRefAny
, _possiblyRestrictedTypeSymbol.Type);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (7)
RefStructInterfacesTests.cs (6)
23338
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "T").WithArguments("T").WithLocation(5, 12),
23341
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "S").WithArguments("S").WithLocation(11, 12)
23375
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "T").WithArguments("T").WithLocation(7, 17),
23378
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "S").WithArguments("S").WithLocation(15, 17)
23412
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "new [] {x}").WithArguments("T").WithLocation(7, 13),
23415
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "new [] {y}").WithArguments("S").WithLocation(15, 13)
Semantics\CollectionExpressionTests.cs (1)
30920
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "S").WithArguments("S").WithLocation(4, 28),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (26)
Semantics\RefEscapingTests.cs (5)
6748
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "TestStruct").WithArguments("TestStruct").WithLocation(8, 36));
6774
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "TestStruct").WithArguments("TestStruct").WithLocation(8, 36));
7030
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "S").WithArguments("S").WithLocation(8, 15),
7033
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "S").WithArguments("S").WithLocation(10, 19)
7087
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "Span<Thing>").WithArguments("System.Span<Thing>").WithLocation(5, 21));
Semantics\SemanticErrorTests.cs (5)
11532
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(4, 12),
11535
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "System.RuntimeArgumentHandle").WithArguments("System.RuntimeArgumentHandle").WithLocation(5, 12));
11557
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "new[] { new ArgIterator() }").WithArguments("System.ArgIterator").WithLocation(6, 17),
11560
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "new[] { new TypedReference() }").WithArguments("System.TypedReference").WithLocation(7, 17),
11563
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "new[] { new RuntimeArgumentHandle() }").WithArguments("System.RuntimeArgumentHandle").WithLocation(8, 17));
Semantics\SpanStackSafetyTests.cs (2)
478
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "Span<int>").WithArguments("System.Span<int>"),
481
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "SpanLike<int>").WithArguments("System.SpanLike<int>").WithLocation(10, 21)
Semantics\StackAllocInitializerTests.cs (12)
70
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "RefS").WithArguments("RefS").WithLocation(16, 22),
73
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "RefG<string>").WithArguments("RefG<string>").WithLocation(17, 22),
76
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "RefG<int>").WithArguments("RefG<int>").WithLocation(18, 22),
79
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(19, 22),
82
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "System.ArgIterator").WithArguments("System.ArgIterator").WithLocation(20, 22),
85
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "System.RuntimeArgumentHandle").WithArguments("System.RuntimeArgumentHandle").WithLocation(21, 22),
88
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "RefS").WithArguments("RefS").WithLocation(23, 9),
91
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "RefG<string>").WithArguments("RefG<string>").WithLocation(24, 9),
94
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "RefG<int>").WithArguments("RefG<int>").WithLocation(25, 9),
97
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(26, 9),
100
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "System.ArgIterator").WithArguments("System.ArgIterator").WithLocation(27, 9),
103
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "System.RuntimeArgumentHandle").WithArguments("System.RuntimeArgumentHandle").WithLocation(28, 9)
Semantics\UnsafeTests.cs (2)
5970
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(4, 19),
5973
Diagnostic(ErrorCode.
ERR_ArrayElementCantBeRefAny
, "System.TypedReference").WithArguments("System.TypedReference").WithLocation(4, 45)