29 references to ERR_CollectionExpressionEscape
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder.ValueChecks.cs (1)
5338
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)
24295
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.Span<T>").WithLocation(5, 39),
24298
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.ReadOnlySpan<T>").WithLocation(6, 47),
24301
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..e]").WithArguments("System.ReadOnlySpan<T>").WithLocation(7, 55));
24383
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.Span<int>").WithLocation(7, 26));
24447
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("MyCollection<T>").WithLocation(12, 60));
24580
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("MyCollection<T>").WithLocation(12, 60));
25254
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[3]").WithArguments("System.ReadOnlySpan<int?>").WithLocation(12, 14),
25260
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[4]").WithArguments("System.ReadOnlySpan<int?>").WithLocation(13, 12));
25629
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("System.Span<T>").WithLocation(4, 36),
25635
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..y]").WithArguments("System.Span<T>").WithLocation(7, 35));
25795
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[3]").WithArguments($"System.{spanType}").WithLocation(17, 14));
25980
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1]").WithArguments("System.ReadOnlySpan<object>").WithLocation(11, 15));
26062
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.ReadOnlySpan<object>").WithLocation(4, 37));
26260
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1]").WithArguments("System.Span<object>").WithLocation(9, 13));
26297
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[2]").WithArguments("System.ReadOnlySpan<object>").WithLocation(14, 17),
26333
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("System.Span<T>").WithLocation(13, 17),
26336
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[z, w]").WithArguments("System.Span<T>").WithLocation(17, 17));
26365
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..a]").WithArguments("System.Span<T>").WithLocation(13, 17));
26697
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[M1()]").WithArguments("System.ReadOnlySpan<int>").WithLocation(5, 32)
27025
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..S.GetSpan(), 3]").WithArguments("System.ReadOnlySpan<object>").WithLocation(3, 7),
27394
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.Span<int>").WithLocation(4, 43),
27397
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, c]").WithArguments("System.ReadOnlySpan<int>").WithLocation(5, 53));
33523
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[[]]").WithArguments("S").WithLocation(15, 21));
33548
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("S<int>").WithLocation(11, 26));
33637
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));