80 references to ERR_CollectionExpressionTargetTypeNotConstructible
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Conversions.cs (1)
1843
Error(diagnostics, ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, node.Syntax, targetType);
Errors\ErrorFacts.cs (1)
2394
or ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (76)
Semantics\CollectionExpressionTests.cs (76)
191
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("object").WithLocation(5, 20),
194
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("dynamic").WithLocation(6, 21),
226
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1]").WithArguments("object").WithLocation(5, 20),
229
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[2]").WithArguments("dynamic").WithLocation(6, 21),
261
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, @"[1, """"]").WithArguments("object").WithLocation(5, 20),
264
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, @"[2, """"]").WithArguments("dynamic").WithLocation(6, 21),
289
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[null]").WithArguments("object").WithLocation(5, 20),
292
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[null]").WithArguments("dynamic").WithLocation(6, 21),
320
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, null]").WithArguments("object").WithLocation(6, 20),
323
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, null]").WithArguments("dynamic").WithLocation(7, 21));
342
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("object").WithLocation(5, 23));
361
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[2]").WithArguments("object").WithLocation(5, 23));
474
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1]").WithArguments("System.Collections.IEnumerable").WithLocation(6, 25),
477
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[2]").WithArguments("System.Collections.ICollection").WithLocation(7, 25),
480
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3]").WithArguments("System.Collections.IList").WithLocation(8, 19));
558
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[null, 2]").WithArguments("object").WithLocation(6, 20));
3958
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[null, default, 0]").WithArguments("int[*,*]").WithLocation(7, 11));
4018
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1]").WithArguments("dynamic").WithLocation(10, 12),
4021
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3]").WithArguments("D").WithLocation(11, 12),
4024
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[5]").WithArguments("E").WithLocation(12, 12));
4979
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[2]").WithArguments("System.Collections.Generic.IA").WithLocation(7, 16),
4982
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3]").WithArguments("System.Collections.Generic.IB<object>").WithLocation(8, 24),
4985
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[4]").WithArguments("System.Collections.Generic.IC<object>").WithLocation(9, 24),
4988
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[5]").WithArguments("System.Collections.Generic.ID<object, object>").WithLocation(10, 32));
5043
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[2]").WithArguments("System.IEquatable<int>").WithLocation(8, 29));
5091
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1]").WithArguments("System.Collections.Generic.List<int>").WithLocation(7, 23),
5356
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("object[*,*]").WithLocation(5, 23),
5359
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[null, 2]").WithArguments("int[*,*]").WithLocation(6, 20));
5378
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[[1, 2], [3, 4]]").WithArguments("int[*,*]").WithLocation(5, 20));
5735
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("I").WithLocation(26, 13),
5738
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3, 4]").WithArguments("I").WithLocation(27, 13));
5885
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("E").WithLocation(7, 13),
5888
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("E").WithLocation(8, 13));
5936
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("E").WithLocation(7, 13),
5939
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("E").WithLocation(8, 13));
5961
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("D").WithLocation(7, 13),
5964
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("D").WithLocation(8, 13));
6014
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("D").WithLocation(7, 13),
6017
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("D").WithLocation(8, 13));
6038
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("int*").WithLocation(5, 18),
6041
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("int*").WithLocation(6, 18),
6044
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3]").WithArguments("int*").WithLocation(7, 23));
6065
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("delegate*<void>").WithLocation(5, 29),
6068
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("delegate*<void>").WithLocation(6, 29),
6071
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3]").WithArguments("delegate*<void>").WithLocation(7, 34));
6513
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S").WithLocation(2, 5),
6516
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("S").WithLocation(3, 5),
6519
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[default]").WithArguments("S").WithLocation(4, 5),
7271
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("int").WithLocation(5, 21),
7274
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("int").WithLocation(5, 25));
8676
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, @"[""1"", default]").WithArguments("MyCollection").WithLocation(5, 26),
8679
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[..x]").WithArguments("MyCollection").WithLocation(6, 26));
9184
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S").WithLocation(8, 15),
9187
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("S").WithLocation(9, 24));
10102
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, 3]").WithArguments("System.Collections.IEnumerable").WithLocation(6, 11),
14388
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, 3]").WithArguments("int?").WithLocation(1, 10)
14843
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S").WithLocation(9, 15),
14846
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("S").WithLocation(10, 13),
14849
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3, 4]").WithArguments("S").WithLocation(11, 17));
14874
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S").WithLocation(9, 15),
14877
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("S").WithLocation(10, 13),
14880
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3, 4]").WithArguments("S").WithLocation(11, 17));
15083
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S2").WithLocation(21, 17),
15086
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S2").WithLocation(27, 24));
26952
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[x, ..y]").WithArguments("object").WithLocation(5, 26));
27857
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[new A()]").WithArguments("B").WithLocation(1, 7),
27860
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[new A()]").WithArguments("B").WithLocation(2, 3));
28060
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("System.Index").WithLocation(7, 9),
28472
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1]").WithArguments("int").WithLocation(1, 4)
30525
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, 3]").WithArguments("System.Collections.Immutable.ImmutableArray<int>").WithLocation(7, 35));
30547
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, 3]").WithArguments("System.Collections.Immutable.ImmutableArray<int>").WithLocation(7, 35));
30988
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, 3]").WithArguments("System.Collections.Immutable.ImmutableArray<int>").WithLocation(5, 40),
30991
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[x, y]").WithArguments("System.Collections.Immutable.ImmutableArray<int>").WithLocation(6, 52));
43332
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[new object()]").WithArguments("Container<object>").WithLocation(7, 31));
43361
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[new object()]").WithArguments("Container<object>").WithLocation(7, 36));
43390
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("Container<int>").WithLocation(7, 36));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Parsing\StatementAttributeParsingTests.cs (2)
6018
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[A]").WithArguments("System.Index").WithLocation(6, 9),
6110
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[A]").WithArguments("System.Index").WithLocation(6, 9),