22 references to ERR_CollectionExpressionEscape
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder.ValueChecks.cs (1)
5265
Error(diagnostics, ErrorCode.
ERR_CollectionExpressionEscape
, node, expr.Type);
Errors\ErrorFacts.cs (1)
2422
or ErrorCode.
ERR_CollectionExpressionEscape
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (20)
Semantics\CollectionExpressionTests.cs (20)
22453
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.Span<T>").WithLocation(5, 39),
22456
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.ReadOnlySpan<T>").WithLocation(6, 47),
22459
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..e]").WithArguments("System.ReadOnlySpan<T>").WithLocation(7, 55));
22541
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.Span<int>").WithLocation(7, 26));
22605
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("MyCollection<T>").WithLocation(12, 60));
22738
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("MyCollection<T>").WithLocation(12, 60));
23412
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[3]").WithArguments("System.ReadOnlySpan<int?>").WithLocation(12, 14),
23418
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[4]").WithArguments("System.ReadOnlySpan<int?>").WithLocation(13, 12));
23787
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("System.Span<T>").WithLocation(4, 36),
23793
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..y]").WithArguments("System.Span<T>").WithLocation(7, 35));
23953
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[3]").WithArguments($"System.{spanType}").WithLocation(17, 14));
24138
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1]").WithArguments("System.ReadOnlySpan<object>").WithLocation(11, 15));
24220
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.ReadOnlySpan<object>").WithLocation(4, 37));
24418
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1]").WithArguments("System.Span<object>").WithLocation(9, 13));
25165
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..S.GetSpan(), 3]").WithArguments("System.ReadOnlySpan<object>").WithLocation(3, 7),
25534
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.Span<int>").WithLocation(4, 43),
25537
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, c]").WithArguments("System.ReadOnlySpan<int>").WithLocation(5, 53));
30923
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[[]]").WithArguments("S").WithLocation(15, 21));
30948
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("S<int>").WithLocation(11, 26));
31037
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.Collections.Immutable.ImmutableArray<int>").WithLocation(6, 52));