41 references to ERR_BadArgTypesForCollectionAdd
Microsoft.CodeAnalysis.CSharp (2)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1167
diagnostics.Add(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, location, symbols, method);
Errors\ErrorFacts.cs (1)
1447
or ErrorCode.
ERR_BadArgTypesForCollectionAdd
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (36)
Semantics\CollectionExpressionTests.cs (35)
9170
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("S<T, U>.Add(T)").WithLocation(11, 50),
9877
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "3").WithArguments("Extensions.Add<int>(ref MyCollection<int>, string)").WithLocation(20, 21),
9883
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "4").WithArguments("Extensions.Add<int>(ref MyCollection<int>, string)").WithLocation(21, 14),
12907
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "d1").WithArguments("MyCollection.Add(int)").WithLocation(10, 29),
12913
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "d2").WithArguments("MyCollection.Add(int)").WithLocation(10, 35),
12919
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "e1").WithArguments("MyCollection.Add(int)").WithLocation(10, 41),
12925
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "e2").WithArguments("MyCollection.Add(int)").WithLocation(10, 47),
12931
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "(dynamic)x").WithArguments("MyCollection.Add(int)").WithLocation(14, 16),
12937
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "(IEnumerable)y").WithArguments("MyCollection.Add(int)").WithLocation(14, 30));
29740
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "F1()").WithArguments("MyCollection<int>.Add(string)").WithLocation(5, 27),
29749
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "F2()").WithArguments("MyCollection<int>.Add(string)").WithLocation(5, 35));
29833
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "F1()").WithArguments("Extensions.Add<int>(MyCollection<int>, string)").WithLocation(5, 27),
29842
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "F2()").WithArguments("Extensions.Add<int>(MyCollection<int>, string)").WithLocation(5, 35));
29924
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("Extensions.Add<int>(MyCollection<int>, params string[])").WithLocation(5, 27),
29933
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("Extensions.Add<int>(MyCollection<int>, params string[])").WithLocation(5, 32));
31840
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "new object()").WithArguments("MyCollection2<object, int>.Add(int)").WithLocation(4, 33),
31899
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "uint.MaxValue").WithArguments("MyCollection.Add(sbyte)").WithLocation(4, 19),
41981
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<int?>.Add(string)").WithLocation(7, 33),
41990
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<int?>.Add(string)").WithLocation(7, 38));
42231
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<int?>.Add(R)").WithLocation(21, 33),
42240
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<int?>.Add(R)").WithLocation(21, 38),
42243
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "null").WithArguments("MyCollection<int?>.Add(R)").WithLocation(21, 41),
42700
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<int?>.Add(int?[])").WithLocation(7, 33),
42709
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<int?>.Add(int?[])").WithLocation(7, 38));
42892
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<int>.Add(string)").WithLocation(8, 32),
42901
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<int>.Add(string)").WithLocation(8, 37));
43009
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<object>.Add(string)").WithLocation(7, 35),
43018
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<object>.Add(string)").WithLocation(7, 40));
43487
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("Extensions.Add<int>(MyCollection<int>, string)").WithLocation(8, 32),
43496
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("Extensions.Add<int>(MyCollection<int>, string)").WithLocation(8, 37));
43695
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("Extensions.Add(string, int)").WithLocation(20, 40)
44586
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<object>.Add(void*)").WithLocation(7, 35),
44595
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<object>.Add(void*)").WithLocation(7, 40));
44634
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("Extensions1.Add<object>(MyCollection<object>, void*)").WithLocation(7, 35),
44643
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("Extensions1.Add<object>(MyCollection<object>, void*)").WithLocation(7, 40));
Semantics\ExtensionTests.cs (1)
17307
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "object.M").WithArguments("System.Collections.Generic.List<int>.Add(int)").WithLocation(1, 54),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\ObjectAndCollectionInitializerTests.cs (2)
2419
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, @"""hi""").WithArguments("TestClass.Add(int)").WithLocation(14, 49),
2751
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "1").WithArguments("C.Add(string)").WithLocation(10, 27),
Semantics\SemanticErrorTests.cs (1)
18896
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "{ d, GetEnumerator }").WithArguments("C.Add(int, System.RuntimeArgumentHandle)").WithLocation(19, 13),