29 references to ERR_CollectionExpressionEscape
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder.ValueChecks.cs (1)
5289
Error(diagnostics, ErrorCode.
ERR_CollectionExpressionEscape
, node, expr.Type);
Errors\ErrorFacts.cs (1)
2421
or ErrorCode.
ERR_CollectionExpressionEscape
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (25)
Semantics\CollectionExpressionTests.cs (25)
24387
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.Span<T>").WithLocation(5, 39),
24390
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.ReadOnlySpan<T>").WithLocation(6, 47),
24393
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..e]").WithArguments("System.ReadOnlySpan<T>").WithLocation(7, 55));
24475
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.Span<int>").WithLocation(7, 26));
24539
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("MyCollection<T>").WithLocation(12, 60));
24672
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("MyCollection<T>").WithLocation(12, 60));
25346
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[3]").WithArguments("System.ReadOnlySpan<int?>").WithLocation(12, 14),
25352
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[4]").WithArguments("System.ReadOnlySpan<int?>").WithLocation(13, 12));
25721
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("System.Span<T>").WithLocation(4, 36),
25727
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..y]").WithArguments("System.Span<T>").WithLocation(7, 35));
25887
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[3]").WithArguments($"System.{spanType}").WithLocation(17, 14));
26072
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1]").WithArguments("System.ReadOnlySpan<object>").WithLocation(11, 15));
26154
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.ReadOnlySpan<object>").WithLocation(4, 37));
26352
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1]").WithArguments("System.Span<object>").WithLocation(9, 13));
26389
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[2]").WithArguments("System.ReadOnlySpan<object>").WithLocation(14, 17),
26425
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("System.Span<T>").WithLocation(13, 17),
26428
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[z, w]").WithArguments("System.Span<T>").WithLocation(17, 17));
26457
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..a]").WithArguments("System.Span<T>").WithLocation(13, 17));
26789
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[M1()]").WithArguments("System.ReadOnlySpan<int>").WithLocation(5, 32)
27117
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..S.GetSpan(), 3]").WithArguments("System.ReadOnlySpan<object>").WithLocation(3, 7),
27486
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.Span<int>").WithLocation(4, 43),
27489
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, c]").WithArguments("System.ReadOnlySpan<int>").WithLocation(5, 53));
33615
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[[]]").WithArguments("S").WithLocation(15, 21));
33640
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("S<int>").WithLocation(11, 26));
33729
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.Collections.Immutable.ImmutableArray<int>").WithLocation(6, 52));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\RefEscapingTests.cs (2)
4706
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[local]").WithArguments("R").WithLocation(7, 16));
4739
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[local]").WithArguments("R").WithLocation(10, 16));