67 references to ERR_CollectionExpressionEscape
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder.ValueChecks.cs (1)
5345
Error(diagnostics, ErrorCode.
ERR_CollectionExpressionEscape
, node, expr.Type);
Errors\ErrorFacts.cs (1)
2423
or ErrorCode.
ERR_CollectionExpressionEscape
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (26)
Semantics\CollectionExpressionTests.cs (25)
24433
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.Span<T>").WithLocation(5, 39),
24436
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.ReadOnlySpan<T>").WithLocation(6, 47),
24439
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..e]").WithArguments("System.ReadOnlySpan<T>").WithLocation(7, 55));
24521
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.Span<int>").WithLocation(7, 26));
24585
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("MyCollection<T>").WithLocation(12, 60));
24718
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("MyCollection<T>").WithLocation(12, 60));
25392
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[3]").WithArguments("System.ReadOnlySpan<int?>").WithLocation(12, 14),
25398
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[4]").WithArguments("System.ReadOnlySpan<int?>").WithLocation(13, 12));
25767
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("System.Span<T>").WithLocation(4, 36),
25773
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..y]").WithArguments("System.Span<T>").WithLocation(7, 35));
25933
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[3]").WithArguments($"System.{spanType}").WithLocation(17, 14));
26118
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1]").WithArguments("System.ReadOnlySpan<object>").WithLocation(11, 15));
26200
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.ReadOnlySpan<object>").WithLocation(4, 37));
26398
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1]").WithArguments("System.Span<object>").WithLocation(9, 13));
26435
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[2]").WithArguments("System.ReadOnlySpan<object>").WithLocation(14, 17),
26471
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y, z]").WithArguments("System.Span<T>").WithLocation(13, 17),
26474
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[z, w]").WithArguments("System.Span<T>").WithLocation(17, 17));
26503
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..a]").WithArguments("System.Span<T>").WithLocation(13, 17));
26835
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[M1()]").WithArguments("System.ReadOnlySpan<int>").WithLocation(5, 32)
27163
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[..S.GetSpan(), 3]").WithArguments("System.ReadOnlySpan<object>").WithLocation(3, 7),
27532
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("System.Span<int>").WithLocation(4, 43),
27535
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, c]").WithArguments("System.ReadOnlySpan<int>").WithLocation(5, 53));
33685
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[[]]").WithArguments("S").WithLocation(15, 21),
33713
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[1, 2, 3]").WithArguments("S<int>").WithLocation(11, 26));
33802
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.Collections.Immutable.ImmutableArray<int>").WithLocation(6, 52));
Semantics\CollectionExpressionTests_WithElement_Extra.cs (1)
5813
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[x, y]").WithArguments("System.ReadOnlySpan<T>").WithLocation(8, 30),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (39)
Semantics\RefEscapingTests.cs (39)
4708
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[local]").WithArguments("R").WithLocation(7, 16));
4741
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[local]").WithArguments("R").WithLocation(10, 16));
4784
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local)]").WithArguments("R").WithLocation(10, 16));
4827
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1)]").WithArguments("R").WithLocation(9, 16));
4871
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local)]").WithArguments("R").WithLocation(10, 13));
4914
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1)]").WithArguments("R").WithLocation(9, 13));
5009
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(), local]").WithArguments("R").WithLocation(10, 16));
5073
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(), local]").WithArguments("R").WithLocation(10, 13));
5140
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local), local]").WithArguments("R").WithLocation(10, 16));
5182
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1), 1]").WithArguments("R").WithLocation(9, 16));
5220
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local), local]").WithArguments("R").WithLocation(10, 13));
5262
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1), 1]").WithArguments("R").WithLocation(9, 13));
5306
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local), 1]").WithArguments("R").WithLocation(10, 16));
5344
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1), local]").WithArguments("R").WithLocation(10, 16));
5387
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local), 1]").WithArguments("R").WithLocation(10, 13));
5425
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1), local]").WithArguments("R").WithLocation(10, 13));
5518
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(ref a)]").WithArguments("R").WithLocation(9, 16));
5999
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local)]").WithArguments("R").WithLocation(7, 16));
6029
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1)]").WithArguments("R").WithLocation(6, 16));
6060
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local)]").WithArguments("R").WithLocation(7, 13));
6090
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1)]").WithArguments("R").WithLocation(6, 13));
6116
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with()]").WithArguments("R").WithLocation(6, 16));
6142
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with()]").WithArguments("R").WithLocation(6, 13));
6169
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(), local]").WithArguments("R").WithLocation(7, 16));
6195
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(), 1]").WithArguments("R").WithLocation(6, 16));
6222
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(), local]").WithArguments("R").WithLocation(7, 13));
6248
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(), 1]").WithArguments("R").WithLocation(6, 13));
6279
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local), local]").WithArguments("R").WithLocation(7, 16));
6309
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1), 1]").WithArguments("R").WithLocation(6, 16));
6340
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local), local]").WithArguments("R").WithLocation(7, 13));
6370
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1), 1]").WithArguments("R").WithLocation(6, 13));
6401
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local), 1]").WithArguments("R").WithLocation(7, 16));
6432
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1), local]").WithArguments("R").WithLocation(7, 16));
6463
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(local), 1]").WithArguments("R").WithLocation(7, 13));
6494
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(1), local]").WithArguments("R").WithLocation(7, 13));
6521
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(ref a)]").WithArguments("R").WithLocation(6, 16));
6548
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(ref a)]").WithArguments("R").WithLocation(6, 16));
6575
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(ref a)]").WithArguments("R").WithLocation(6, 16));
6602
Diagnostic(ErrorCode.
ERR_CollectionExpressionEscape
, "[with(ref a)]").WithArguments("R").WithLocation(6, 16));