81 references to ERR_CollectionExpressionTargetTypeNotConstructible
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Conversions.cs (1)
1825
Error(diagnostics, ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, node.Syntax, targetType);
Errors\ErrorFacts.cs (1)
2393
or ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (77)
Semantics\CollectionExpressionTests.cs (76)
190
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("object").WithLocation(5, 20),
193
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("dynamic").WithLocation(6, 21),
225
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1]").WithArguments("object").WithLocation(5, 20),
228
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[2]").WithArguments("dynamic").WithLocation(6, 21),
260
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, @"[1, """"]").WithArguments("object").WithLocation(5, 20),
263
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, @"[2, """"]").WithArguments("dynamic").WithLocation(6, 21),
288
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[null]").WithArguments("object").WithLocation(5, 20),
291
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[null]").WithArguments("dynamic").WithLocation(6, 21),
319
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, null]").WithArguments("object").WithLocation(6, 20),
322
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, null]").WithArguments("dynamic").WithLocation(7, 21));
341
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("object").WithLocation(5, 23));
360
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[2]").WithArguments("object").WithLocation(5, 23));
473
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1]").WithArguments("System.Collections.IEnumerable").WithLocation(6, 25),
476
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[2]").WithArguments("System.Collections.ICollection").WithLocation(7, 25),
479
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3]").WithArguments("System.Collections.IList").WithLocation(8, 19));
557
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[null, 2]").WithArguments("object").WithLocation(6, 20));
3957
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[null, default, 0]").WithArguments("int[*,*]").WithLocation(7, 11));
4017
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1]").WithArguments("dynamic").WithLocation(10, 12),
4020
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3]").WithArguments("D").WithLocation(11, 12),
4023
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[5]").WithArguments("E").WithLocation(12, 12));
4978
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[2]").WithArguments("System.Collections.Generic.IA").WithLocation(7, 16),
4981
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3]").WithArguments("System.Collections.Generic.IB<object>").WithLocation(8, 24),
4984
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[4]").WithArguments("System.Collections.Generic.IC<object>").WithLocation(9, 24),
4987
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[5]").WithArguments("System.Collections.Generic.ID<object, object>").WithLocation(10, 32));
5042
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[2]").WithArguments("System.IEquatable<int>").WithLocation(8, 29));
6100
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1]").WithArguments("System.Collections.Generic.List<int>").WithLocation(7, 23),
6365
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("object[*,*]").WithLocation(5, 23),
6368
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[null, 2]").WithArguments("int[*,*]").WithLocation(6, 20));
6387
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[[1, 2], [3, 4]]").WithArguments("int[*,*]").WithLocation(5, 20));
7574
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("I").WithLocation(26, 13),
7577
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3, 4]").WithArguments("I").WithLocation(27, 13));
7724
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("E").WithLocation(7, 13),
7727
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("E").WithLocation(8, 13));
7775
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("E").WithLocation(7, 13),
7778
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("E").WithLocation(8, 13));
7800
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("D").WithLocation(7, 13),
7803
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("D").WithLocation(8, 13));
7853
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("D").WithLocation(7, 13),
7856
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("D").WithLocation(8, 13));
7877
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("int*").WithLocation(5, 18),
7880
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("int*").WithLocation(6, 18),
7883
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3]").WithArguments("int*").WithLocation(7, 23));
7904
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("delegate*<void>").WithLocation(5, 29),
7907
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("delegate*<void>").WithLocation(6, 29),
7910
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3]").WithArguments("delegate*<void>").WithLocation(7, 34));
8352
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S").WithLocation(2, 5),
8355
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("S").WithLocation(3, 5),
8358
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[default]").WithArguments("S").WithLocation(4, 5),
9110
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("int").WithLocation(5, 21),
9113
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("int").WithLocation(5, 25));
10515
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, @"[""1"", default]").WithArguments("MyCollection").WithLocation(5, 26),
10518
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[..x]").WithArguments("MyCollection").WithLocation(6, 26));
11023
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S").WithLocation(8, 15),
11026
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("S").WithLocation(9, 24));
11942
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, 3]").WithArguments("System.Collections.IEnumerable").WithLocation(6, 11),
16230
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, 3]").WithArguments("int?").WithLocation(1, 10)
16685
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S").WithLocation(9, 15),
16688
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("S").WithLocation(10, 13),
16691
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3, 4]").WithArguments("S").WithLocation(11, 17));
16716
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S").WithLocation(9, 15),
16719
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("S").WithLocation(10, 13),
16722
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[3, 4]").WithArguments("S").WithLocation(11, 17));
16925
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S2").WithLocation(21, 17),
16928
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("S2").WithLocation(27, 24));
29189
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[x, ..y]").WithArguments("object").WithLocation(5, 26));
30094
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[new A()]").WithArguments("B").WithLocation(1, 7),
30097
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[new A()]").WithArguments("B").WithLocation(2, 3));
30297
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[]").WithArguments("System.Index").WithLocation(7, 9),
30709
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1]").WithArguments("int").WithLocation(1, 4)
32762
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, 3]").WithArguments("System.Collections.Immutable.ImmutableArray<int>").WithLocation(7, 35));
32784
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, 3]").WithArguments("System.Collections.Immutable.ImmutableArray<int>").WithLocation(7, 35));
33588
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2, 3]").WithArguments("System.Collections.Immutable.ImmutableArray<int>").WithLocation(5, 40),
33591
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[x, y]").WithArguments("System.Collections.Immutable.ImmutableArray<int>").WithLocation(6, 52));
46114
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[new object()]").WithArguments("Container<object>").WithLocation(7, 31));
46143
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[new object()]").WithArguments("Container<object>").WithLocation(7, 36));
46172
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[1, 2]").WithArguments("Container<int>").WithLocation(7, 36));
Semantics\ExtensionTests2.cs (1)
36387
Diagnostic(ErrorCode.
ERR_CollectionExpressionTargetTypeNotConstructible
, "[10]").WithArguments("object").WithLocation(1, 10));
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),