41 references to ERR_BadArgTypesForCollectionAdd
Microsoft.CodeAnalysis.CSharp (2)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1137
diagnostics.Add(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, location, symbols, method);
Errors\ErrorFacts.cs (1)
1445
or ErrorCode.
ERR_BadArgTypesForCollectionAdd
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (36)
Semantics\CollectionExpressionTests.cs (35)
7331
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("S<T, U>.Add(T)").WithLocation(11, 50),
8038
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "3").WithArguments("Extensions.Add<int>(ref MyCollection<int>, string)").WithLocation(20, 21),
8044
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "4").WithArguments("Extensions.Add<int>(ref MyCollection<int>, string)").WithLocation(21, 14),
11067
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "d1").WithArguments("MyCollection.Add(int)").WithLocation(10, 29),
11073
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "d2").WithArguments("MyCollection.Add(int)").WithLocation(10, 35),
11079
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "e1").WithArguments("MyCollection.Add(int)").WithLocation(10, 41),
11085
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "e2").WithArguments("MyCollection.Add(int)").WithLocation(10, 47),
11091
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "(dynamic)x").WithArguments("MyCollection.Add(int)").WithLocation(14, 16),
11097
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "(IEnumerable)y").WithArguments("MyCollection.Add(int)").WithLocation(14, 30));
27503
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "F1()").WithArguments("MyCollection<int>.Add(string)").WithLocation(5, 27),
27512
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "F2()").WithArguments("MyCollection<int>.Add(string)").WithLocation(5, 35));
27596
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "F1()").WithArguments("Extensions.Add<int>(MyCollection<int>, string)").WithLocation(5, 27),
27605
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "F2()").WithArguments("Extensions.Add<int>(MyCollection<int>, string)").WithLocation(5, 35));
27687
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("Extensions.Add<int>(MyCollection<int>, params string[])").WithLocation(5, 27),
27696
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("Extensions.Add<int>(MyCollection<int>, params string[])").WithLocation(5, 32));
29603
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "new object()").WithArguments("MyCollection2<object, int>.Add(int)").WithLocation(4, 33),
29662
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "uint.MaxValue").WithArguments("MyCollection.Add(sbyte)").WithLocation(4, 19),
39202
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<int?>.Add(string)").WithLocation(7, 33),
39211
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<int?>.Add(string)").WithLocation(7, 38));
39452
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<int?>.Add(R)").WithLocation(21, 33),
39461
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<int?>.Add(R)").WithLocation(21, 38),
39464
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "null").WithArguments("MyCollection<int?>.Add(R)").WithLocation(21, 41),
39921
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<int?>.Add(int?[])").WithLocation(7, 33),
39930
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<int?>.Add(int?[])").WithLocation(7, 38));
40113
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<int>.Add(string)").WithLocation(8, 32),
40122
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<int>.Add(string)").WithLocation(8, 37));
40230
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<object>.Add(string)").WithLocation(7, 35),
40239
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<object>.Add(string)").WithLocation(7, 40));
40708
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("Extensions.Add<int>(MyCollection<int>, string)").WithLocation(8, 32),
40717
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("Extensions.Add<int>(MyCollection<int>, string)").WithLocation(8, 37));
40916
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("Extensions.Add(string, int)").WithLocation(20, 40)
41804
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("MyCollection<object>.Add(void*)").WithLocation(7, 35),
41813
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("MyCollection<object>.Add(void*)").WithLocation(7, 40));
41852
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "x").WithArguments("Extensions1.Add<object>(MyCollection<object>, void*)").WithLocation(7, 35),
41861
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "y").WithArguments("Extensions1.Add<object>(MyCollection<object>, void*)").WithLocation(7, 40));
Semantics\ExtensionTests.cs (1)
16179
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)
18849
Diagnostic(ErrorCode.
ERR_BadArgTypesForCollectionAdd
, "{ d, GetEnumerator }").WithArguments("C.Add(int, System.RuntimeArgumentHandle)").WithLocation(19, 13),