614 references to ERR_BadArgType
Microsoft.CodeAnalysis.CSharp (5)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (4)
1180
ErrorCode.
ERR_BadArgType
,
1246
ErrorCode.
ERR_BadArgType
,
1349
ErrorCode.
ERR_BadArgType
,
1360
ErrorCode.
ERR_BadArgType
,
Errors\ErrorFacts.cs (1)
1204
or ErrorCode.
ERR_BadArgType
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (22)
CodeGen\CodeGenAsyncSpillTests.cs (1)
3498
Diagnostic(ErrorCode.
ERR_BadArgType
, "s").WithArguments("1", "in string", "in object").WithLocation(7, 14));
CodeGen\CodeGenAsyncTests.cs (1)
3648
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""hello""").WithArguments("1", "string", "System.Type").WithLocation(5, 21),
CodeGen\CodeGenDynamicTests.cs (2)
8860
Diagnostic(ErrorCode.
ERR_BadArgType
, "d").WithArguments("1", "ref dynamic", "ref int").WithLocation(19, 15),
8863
Diagnostic(ErrorCode.
ERR_BadArgType
, "d").WithArguments("2", "out dynamic", "out int").WithLocation(19, 22)
CodeGen\CodeGenFunctionPointersTests.cs (3)
3506
Diagnostic(ErrorCode.
ERR_BadArgType
, "&M").WithArguments("1", "&method group", "ref delegate*<void>").WithLocation(9, 12),
11919
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(delegate*<void>)").WithArguments("1", "delegate*<void>", "object").WithLocation(6, 4));
12020
Diagnostic(ErrorCode.
ERR_BadArgType
, "new B<delegate*<void>[]>.E[]{}").WithArguments("1", "B<delegate*<void>[]>.E[]", "object[]").WithLocation(11, 4));
CodeGen\CodeGenNullCoalescingAssignmentTests.cs (2)
1690
Diagnostic(ErrorCode.
ERR_BadArgType
, "d ??= 3.0").WithArguments("1", "double", "C").WithLocation(7, 12),
1693
Diagnostic(ErrorCode.
ERR_BadArgType
, "o ??= null").WithArguments("1", "object", "C").WithLocation(9, 12),
CodeGen\CodeGenTupleTest.cs (9)
3865
Diagnostic(ErrorCode.
ERR_BadArgType
, "GetTuple().a").WithArguments("1", "method group", "string")
10238
Diagnostic(ErrorCode.
ERR_BadArgType
, "Nullable((a: 1, b: (a: 1, b: 2)))").WithArguments("1", "(int a, (int a, int b) b)?", "(int, object)").WithLocation(6, 15),
10241
Diagnostic(ErrorCode.
ERR_BadArgType
, "Nullable((a: 1, b: (object)1))").WithArguments("2", "(int a, object b)?", "(int, (int a, int b))").WithLocation(7, 40)
16437
Diagnostic(ErrorCode.
ERR_BadArgType
, @"(null, ""2"")").WithArguments("1", "<tuple>", "(int, string)").WithLocation(11, 20),
16464
Diagnostic(ErrorCode.
ERR_BadArgType
, @"(""11"", ""11"")").WithArguments("1", "<tuple>", "(int, string)").WithLocation(28, 20),
18830
Diagnostic(ErrorCode.
ERR_BadArgType
, "z").WithArguments("1", "(System.Action<System.Collections.IEnumerable> x, System.Action<System.Collections.IEnumerable> y)", "System.Action<(System.Collections.Generic.IEnumerable<int>, System.Collections.Generic.IEnumerable<int>)>").WithLocation(25, 54),
18833
Diagnostic(ErrorCode.
ERR_BadArgType
, "z1").WithArguments("2", "(System.Action<System.Collections.Generic.IEnumerable<int>> x, System.Action<System.Collections.Generic.IEnumerable<int>> y)", "System.Action<(System.Collections.Generic.IEnumerable<int>, System.Collections.Generic.IEnumerable<int>)>").WithLocation(25, 57)
22643
Diagnostic(ErrorCode.
ERR_BadArgType
, "(1, 2)").WithArguments("1", "(int, int)", "int").WithLocation(9, 11));
22665
Diagnostic(ErrorCode.
ERR_BadArgType
, "(1, null)").WithArguments("1", "(int, <null>)", "int").WithLocation(9, 11));
CodeGen\PatternTests.cs (1)
4998
Diagnostic(ErrorCode.
ERR_BadArgType
, "1 switch { 1 => 1, _ => string.Empty }").WithArguments("1", "<switch expression>", "int").WithLocation(11, 9)
Emit\NoPiaEmbedTypes.cs (1)
3166
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""124""").WithArguments("1", "string", "int").WithLocation(12, 53)
PrivateProtected.cs (2)
177
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "string").WithLocation(11, 14),
228
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "string").WithLocation(11, 14),
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (17)
CodeGen\IndexAndRangeTests.cs (2)
1084
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int").WithLocation(2, 3),
1087
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int").WithLocation(4, 23)
Emit\NumericIntPtrTests.cs (15)
2721
Diagnostic(ErrorCode.
ERR_BadArgType
, "sbyte.MaxValue").WithArguments("1", "sbyte", "ushort").WithLocation(5, 19),
2724
Diagnostic(ErrorCode.
ERR_BadArgType
, "short.MaxValue").WithArguments("1", "short", "ushort").WithLocation(6, 19),
2727
Diagnostic(ErrorCode.
ERR_BadArgType
, "int.MaxValue").WithArguments("1", "int", "ushort").WithLocation(7, 19),
2730
Diagnostic(ErrorCode.
ERR_BadArgType
, "long.MaxValue").WithArguments("1", "long", "ushort").WithLocation(8, 19),
2733
Diagnostic(ErrorCode.
ERR_BadArgType
, "sbyte.MaxValue").WithArguments("1", "sbyte", "uint").WithLocation(9, 17),
2736
Diagnostic(ErrorCode.
ERR_BadArgType
, "short.MaxValue").WithArguments("1", "short", "uint").WithLocation(10, 17),
2739
Diagnostic(ErrorCode.
ERR_BadArgType
, "long.MaxValue").WithArguments("1", "long", "uint").WithLocation(12, 17),
2742
Diagnostic(ErrorCode.
ERR_BadArgType
, "sbyte.MaxValue").WithArguments("1", "sbyte", "nuint").WithLocation(13, 27),
2745
Diagnostic(ErrorCode.
ERR_BadArgType
, "short.MaxValue").WithArguments("1", "short", "nuint").WithLocation(14, 27),
2748
Diagnostic(ErrorCode.
ERR_BadArgType
, "long.MaxValue").WithArguments("1", "long", "nuint").WithLocation(16, 27),
2751
Diagnostic(ErrorCode.
ERR_BadArgType
, "sbyte.MaxValue").WithArguments("1", "sbyte", "nuint").WithLocation(17, 18),
2754
Diagnostic(ErrorCode.
ERR_BadArgType
, "short.MaxValue").WithArguments("1", "short", "nuint").WithLocation(18, 18),
2757
Diagnostic(ErrorCode.
ERR_BadArgType
, "long.MaxValue").WithArguments("1", "long", "nuint").WithLocation(20, 18),
2760
Diagnostic(ErrorCode.
ERR_BadArgType
, "sbyte.MaxValue").WithArguments("1", "sbyte", "ulong").WithLocation(21, 18),
2763
Diagnostic(ErrorCode.
ERR_BadArgType
, "short.MaxValue").WithArguments("1", "short", "ulong").WithLocation(22, 18)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (219)
Attributes\AttributeTests.cs (7)
156
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "System.Type").WithLocation(3, 60)
163
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "System.Type").WithLocation(3, 60)
6271
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "System.AttributeTargets"));
6329
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "System.AttributeTargets"));
6814
Diagnostic(ErrorCode.
ERR_BadArgType
, "Invoke").WithArguments("1", "method group", "int").WithLocation(11, 8),
6817
Diagnostic(ErrorCode.
ERR_BadArgType
, "Invoke").WithArguments("1", "method group", "int").WithLocation(14, 22));
8407
Diagnostic(ErrorCode.
ERR_BadArgType
, "Equals").WithArguments("1", "method group", "int"));
Attributes\AttributeTests_Conditional.cs (1)
681
Diagnostic(ErrorCode.
ERR_BadArgType
, "Bar.M").WithArguments("1", "method group", "string"),
Attributes\AttributeTests_WellKnownAttributes.cs (7)
1818
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "System.Security.Permissions.SecurityAction").WithLocation(149, 16),
3032
Diagnostic(ErrorCode.
ERR_BadArgType
, "true").WithArguments("1", "bool", "string"),
3036
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "string"));
5407
Diagnostic(ErrorCode.
ERR_BadArgType
, "System.Int32.MaxValue").WithArguments("1", "int", "System.Runtime.InteropServices.ClassInterfaceType"),
5486
Diagnostic(ErrorCode.
ERR_BadArgType
, "System.Int32.MaxValue").WithArguments("1", "int", "System.Runtime.InteropServices.ComInterfaceType"),
5550
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""str""").WithArguments("1", "string", "int"));
6584
Diagnostic(ErrorCode.
ERR_BadArgType
, "Method1").WithArguments("1", "method group", "string").WithLocation(31, 15),
Diagnostics\MethodGroupConversion.cs (1)
68
Diagnostic(ErrorCode.
ERR_BadArgType
, "M3").WithArguments("1", "method group", "D").WithLocation(13, 12)
FirstClassSpanTests.cs (22)
4207
Diagnostic(ErrorCode.
ERR_BadArgType
, "arg").WithArguments("1", $"{argModifier(modifier)} string[]", $"{modifier} System.Span<string>").WithLocation(6, 9),
4210
Diagnostic(ErrorCode.
ERR_BadArgType
, "arg").WithArguments("1", $"{argModifier(modifier)} string[]", $"{modifier} System.ReadOnlySpan<string>").WithLocation(10, 9));
4735
Diagnostic(ErrorCode.
ERR_BadArgType
, "a").WithArguments("1", "System.Span<string>", "object").WithLocation(6, 12));
4776
Diagnostic(ErrorCode.
ERR_BadArgType
, "a").WithArguments("1", "System.ReadOnlySpan<string>", "object").WithLocation(6, 12));
4816
Diagnostic(ErrorCode.
ERR_BadArgType
, "a").WithArguments("1", "System.ReadOnlySpan<string>", "object").WithLocation(6, 12));
4951
Diagnostic(ErrorCode.
ERR_BadArgType
, "a.M").WithArguments("1", "method group", "System.Func<int, int>").WithLocation(4, 5)
5078
Diagnostic(ErrorCode.
ERR_BadArgType
, "a.M").WithArguments("1", "method group", "System.Func<int, int>").WithLocation(4, 5),
5081
Diagnostic(ErrorCode.
ERR_BadArgType
, "a.M<int>").WithArguments("1", "method group", "System.Func<int, int>").WithLocation(5, 5)
5495
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "System.Span<string>", "System.ReadOnlySpan<object>").WithLocation(4, 14));
5531
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "System.ReadOnlySpan<string>", "System.ReadOnlySpan<object>").WithLocation(4, 14));
6036
Diagnostic(ErrorCode.
ERR_BadArgType
, "new C()").WithArguments("1", "C", $"System.{destination}<int>").WithLocation(3, 5));
6069
Diagnostic(ErrorCode.
ERR_BadArgType
, "new C()").WithArguments("1", "C", "System.ReadOnlySpan<int>").WithLocation(3, 5));
6102
Diagnostic(ErrorCode.
ERR_BadArgType
, "new C()").WithArguments("1", "C", "System.ReadOnlySpan<object>").WithLocation(3, 5));
6135
Diagnostic(ErrorCode.
ERR_BadArgType
, "new C()").WithArguments("1", "C", "System.ReadOnlySpan<object>").WithLocation(3, 5));
6168
Diagnostic(ErrorCode.
ERR_BadArgType
, "new C()").WithArguments("1", "C", "System.ReadOnlySpan<char>").WithLocation(3, 5));
6300
Diagnostic(ErrorCode.
ERR_BadArgType
, "new C()").WithArguments("1", "C", "System.Span<int>").WithLocation(3, 5)
6373
Diagnostic(ErrorCode.
ERR_BadArgType
, "new C()").WithArguments("1", "C", "System.ReadOnlySpan<int>").WithLocation(3, 5)
8060
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(Span<string>)").WithArguments("1", "System.Span<string>", "System.Span<object>").WithLocation(3, 5),
8063
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(ReadOnlySpan<string>)").WithArguments("1", "System.ReadOnlySpan<string>", "System.Span<object>").WithLocation(4, 5));
8202
Diagnostic(ErrorCode.
ERR_BadArgType
, "new D()").WithArguments("1", "D", "System.Span<string>").WithLocation(3, 5));
9129
Diagnostic(ErrorCode.
ERR_BadArgType
, "a").WithArguments("1", "I<object[]>", "I<System.ReadOnlySpan<object>>").WithLocation(4, 33));
9148
Diagnostic(ErrorCode.
ERR_BadArgType
, "a").WithArguments("1", "I<object[]>", "I<System.ReadOnlySpan<object>>").WithLocation(4, 33));
OverloadResolutionPriorityTests.cs (2)
3050
Diagnostic(ErrorCode.
ERR_BadArgType
, "0L").WithArguments("1", "long", "int").WithLocation(5, 12),
3053
Diagnostic(ErrorCode.
ERR_BadArgType
, "0L").WithArguments("1", "long", "int").WithLocation(6, 12)
RefReadonlyParameterTests.cs (5)
3461
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(object)").WithArguments("1", "object", "string").WithLocation(8, 15));
4503
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "string", "ref readonly int").WithLocation(7, 11),
4506
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "ref string", "ref readonly int").WithLocation(8, 15),
4509
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "in string", "ref readonly int").WithLocation(9, 14));
5772
Diagnostic(ErrorCode.
ERR_BadArgType
, "y").WithArguments("1", "in dynamic", "ref readonly int").WithLocation(12, 16));
Semantics\CollectionExpressionTests.cs (35)
2036
Diagnostic(ErrorCode.
ERR_BadArgType
, "new[] { default }").WithArguments("1", "?[]", "System.Span<int>").WithLocation(5, 19),
7334
Diagnostic(ErrorCode.
ERR_BadArgType
, "y").WithArguments("1", "U", "T").WithLocation(11, 50));
8041
Diagnostic(ErrorCode.
ERR_BadArgType
, "3").WithArguments("2", "int", "string").WithLocation(20, 21),
8047
Diagnostic(ErrorCode.
ERR_BadArgType
, "4").WithArguments("2", "int", "string").WithLocation(21, 14));
11064
Diagnostic(ErrorCode.
ERR_BadArgType
, "..d1").WithArguments("1", "object", "int").WithLocation(10, 27),
11070
Diagnostic(ErrorCode.
ERR_BadArgType
, "..d2").WithArguments("1", "object", "int").WithLocation(10, 33),
11076
Diagnostic(ErrorCode.
ERR_BadArgType
, "..e1").WithArguments("1", "object", "int").WithLocation(10, 39),
11082
Diagnostic(ErrorCode.
ERR_BadArgType
, "..e2").WithArguments("1", "object", "int").WithLocation(10, 45),
11088
Diagnostic(ErrorCode.
ERR_BadArgType
, "..(dynamic)x").WithArguments("1", "object", "int").WithLocation(14, 14),
11094
Diagnostic(ErrorCode.
ERR_BadArgType
, "..(IEnumerable)y").WithArguments("1", "object", "int").WithLocation(14, 28),
27506
Diagnostic(ErrorCode.
ERR_BadArgType
, "F1()").WithArguments("1", "int", "string").WithLocation(5, 27),
27509
Diagnostic(ErrorCode.
ERR_BadArgType
, "..F2()").WithArguments("1", "int", "string").WithLocation(5, 33),
27599
Diagnostic(ErrorCode.
ERR_BadArgType
, "F1()").WithArguments("2", "int", "string").WithLocation(5, 27),
27602
Diagnostic(ErrorCode.
ERR_BadArgType
, "..F2()").WithArguments("2", "int", "string").WithLocation(5, 33),
27690
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("2", "int", "string").WithLocation(5, 27),
27693
Diagnostic(ErrorCode.
ERR_BadArgType
, "..y").WithArguments("2", "int", "string").WithLocation(5, 30),
29606
Diagnostic(ErrorCode.
ERR_BadArgType
, "new object()").WithArguments("1", "object", "int").WithLocation(4, 33)
29665
Diagnostic(ErrorCode.
ERR_BadArgType
, "uint.MaxValue").WithArguments("1", "uint", "sbyte").WithLocation(4, 19)
39205
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "int?", "string").WithLocation(7, 33),
39208
Diagnostic(ErrorCode.
ERR_BadArgType
, "..y").WithArguments("1", "int?", "string").WithLocation(7, 36),
39455
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "int", "R").WithLocation(21, 33),
39458
Diagnostic(ErrorCode.
ERR_BadArgType
, "..y").WithArguments("1", "int", "R").WithLocation(21, 36),
39467
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "R").WithLocation(21, 41));
39924
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "int", "int?[]").WithLocation(7, 33),
39927
Diagnostic(ErrorCode.
ERR_BadArgType
, "..y").WithArguments("1", "int", "int?[]").WithLocation(7, 36),
40116
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "int", "string").WithLocation(8, 32),
40119
Diagnostic(ErrorCode.
ERR_BadArgType
, "..y").WithArguments("1", "int", "string").WithLocation(8, 35),
40233
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "object", "string").WithLocation(7, 35),
40236
Diagnostic(ErrorCode.
ERR_BadArgType
, "..y").WithArguments("1", "object", "string").WithLocation(7, 38),
40711
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("2", "int", "string").WithLocation(8, 32),
40714
Diagnostic(ErrorCode.
ERR_BadArgType
, "..y").WithArguments("2", "int", "string").WithLocation(8, 35),
41807
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "int", "void*").WithLocation(7, 35),
41810
Diagnostic(ErrorCode.
ERR_BadArgType
, "..y").WithArguments("1", "int", "void*").WithLocation(7, 38),
41855
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("2", "int", "void*").WithLocation(7, 35),
41858
Diagnostic(ErrorCode.
ERR_BadArgType
, "..y").WithArguments("2", "int", "void*").WithLocation(7, 38),
Semantics\ExperimentalAttributeTests.cs (1)
1436
Diagnostic(ErrorCode.
ERR_BadArgType
, "42").WithArguments("1", "int", "string").WithLocation(3, 47)
Semantics\ExtensionOperatorsTests.cs (17)
1230
Diagnostic(ErrorCode.
ERR_BadArgType
, "s2").WithArguments("1", "S1?", "S2").WithLocation(27, 34)
6425
Diagnostic(ErrorCode.
ERR_BadArgType
, "s1").WithArguments("1", "ref S1", "ref S1?").WithLocation(21, 48)
6474
Diagnostic(ErrorCode.
ERR_BadArgType
, "s2").WithArguments("1", "S1?", "S2").WithLocation(27, 34)
6521
Diagnostic(ErrorCode.
ERR_BadArgType
, "s1").WithArguments("1", "ref S1", "ref S2").WithLocation(23, 48),
6527
Diagnostic(ErrorCode.
ERR_BadArgType
, "s2").WithArguments("1", "ref S1?", "ref S2").WithLocation(27, 48)
6805
Diagnostic(ErrorCode.
ERR_BadArgType
, "a1").WithArguments("1", "ref int[]", "ref System.Span<int>").WithLocation(18, 48)
12356
Diagnostic(ErrorCode.
ERR_BadArgType
, "s3").WithArguments("1", "S1?", "S2").WithLocation(30, 33),
12359
Diagnostic(ErrorCode.
ERR_BadArgType
, "s3").WithArguments("2", "S1?", "S2").WithLocation(30, 37)
12608
Diagnostic(ErrorCode.
ERR_BadArgType
, "s3").WithArguments("1", "S1?", "S2").WithLocation(30, 34),
12611
Diagnostic(ErrorCode.
ERR_BadArgType
, "s3").WithArguments("2", "S1?", "S2").WithLocation(30, 38)
22131
Diagnostic(ErrorCode.
ERR_BadArgType
, "s1").WithArguments("1", "ref S1", "ref S1?").WithLocation(19, 47)
22186
Diagnostic(ErrorCode.
ERR_BadArgType
, "s3").WithArguments("1", "S1?", "S2").WithLocation(30, 33),
22189
Diagnostic(ErrorCode.
ERR_BadArgType
, "s3").WithArguments("2", "S1?", "S2").WithLocation(30, 37)
22330
Diagnostic(ErrorCode.
ERR_BadArgType
, "s1").WithArguments("1", "ref S1", "ref S2").WithLocation(26, 47),
22336
Diagnostic(ErrorCode.
ERR_BadArgType
, "s3").WithArguments("1", "ref S1?", "ref S2").WithLocation(30, 47),
22339
Diagnostic(ErrorCode.
ERR_BadArgType
, "s3").WithArguments("2", "S1?", "S2").WithLocation(30, 51)
22620
Diagnostic(ErrorCode.
ERR_BadArgType
, "a1").WithArguments("1", "ref int[]", "ref System.Span<int>").WithLocation(18, 47)
Semantics\ExtensionTests.cs (9)
16182
Diagnostic(ErrorCode.
ERR_BadArgType
, "object.M").WithArguments("1", "method group", "int").WithLocation(1, 54));
18091
Diagnostic(ErrorCode.
ERR_BadArgType
, "42").WithArguments("2", "int", "string").WithLocation(4, 11));
22875
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int").WithLocation(4, 7)];
22934
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int").WithLocation(2, 7));
23194
Diagnostic(ErrorCode.
ERR_BadArgType
, "[1]").WithArguments("1", "System.Index", "int").WithLocation(1, 16));
23310
Diagnostic(ErrorCode.
ERR_BadArgType
, ".. var x").WithArguments("1", "System.Range", "System.Index").WithLocation(1, 20));
23351
Diagnostic(ErrorCode.
ERR_BadArgType
, ".. var x").WithArguments("1", "System.Range", "System.Index").WithLocation(1, 20));
23379
Diagnostic(ErrorCode.
ERR_BadArgType
, ".. var x").WithArguments("1", "System.Range", "System.Index").WithLocation(1, 20),
31064
Diagnostic(ErrorCode.
ERR_BadArgType
, "d").WithArguments("2", "dynamic", "__arglist").WithLocation(2, 10));
Semantics\InlineArrayTests.cs (9)
10116
Diagnostic(ErrorCode.
ERR_BadArgType
, "c.F[..]").WithArguments("1", "System.ReadOnlySpan<int>", "System.Span<int>").WithLocation(23, 19)
10309
Diagnostic(ErrorCode.
ERR_BadArgType
, "F[..]").WithArguments("1", "System.ReadOnlySpan<int>", "System.Span<int>").WithLocation(15, 19)
11403
Diagnostic(ErrorCode.
ERR_BadArgType
, "c.F[..]").WithArguments("1", "System.ReadOnlySpan<int>", "System.Span<int>").WithLocation(24, 19)
16537
Diagnostic(ErrorCode.
ERR_BadArgType
, "M3()").WithArguments("1", "Buffer10<int>?", "System.ReadOnlySpan<int>?").WithLocation(9, 27),
16543
Diagnostic(ErrorCode.
ERR_BadArgType
, "M3()").WithArguments("1", "Buffer10<int>?", "System.Span<int>?").WithLocation(18, 27),
16624
Diagnostic(ErrorCode.
ERR_BadArgType
, "M3()").WithArguments("1", "Buffer10<int>", "System.ReadOnlySpan<int>?").WithLocation(9, 27),
16630
Diagnostic(ErrorCode.
ERR_BadArgType
, "M3()").WithArguments("1", "Buffer10<int>", "System.Span<int>?").WithLocation(18, 27),
17391
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(Buffer10)").WithArguments("1", "Buffer10", "System.Span<int>").WithLocation(9, 46)
17418
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(Buffer10)").WithArguments("1", "Buffer10", "System.Span<int>").WithLocation(8, 4)
Semantics\OutVarTests.cs (9)
17779
Diagnostic(ErrorCode.
ERR_BadArgType
, "int x1").WithArguments("1", "out int", "out short").WithLocation(6, 18)
32472
Diagnostic(ErrorCode.
ERR_BadArgType
, "(var x1, int x2)").WithArguments("1", "(var, int)", "object").WithLocation(2, 5)
33120
Diagnostic(ErrorCode.
ERR_BadArgType
, "long x1").WithArguments("1", "out long", "out int").WithLocation(7, 19),
33123
Diagnostic(ErrorCode.
ERR_BadArgType
, "long _").WithArguments("1", "out long", "out int").WithLocation(8, 19),
33232
Diagnostic(ErrorCode.
ERR_BadArgType
, "alias1 _").WithArguments("1", "out alias1", "out int").WithLocation(10, 19),
33235
Diagnostic(ErrorCode.
ERR_BadArgType
, "var _").WithArguments("1", "out var", "out int").WithLocation(11, 19)
33454
Diagnostic(ErrorCode.
ERR_BadArgType
, "byte _").WithArguments("1", "out byte", "out object").WithLocation(10, 15)
33480
Diagnostic(ErrorCode.
ERR_BadArgType
, "A x").WithArguments("2", "out A", "out B").WithLocation(7, 18),
33483
Diagnostic(ErrorCode.
ERR_BadArgType
, "A _").WithArguments("2", "out A", "out B").WithLocation(8, 18)
Semantics\ParamsCollectionTests.cs (48)
207
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params System.Span<long>").WithLocation(5, 7),
323
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params System.ReadOnlySpan<long>").WithLocation(5, 7),
467
Diagnostic(ErrorCode.
ERR_BadArgType
, "'a'").WithArguments("1", "char", "params string").WithLocation(7, 14),
503
Diagnostic(ErrorCode.
ERR_BadArgType
, "'1'").WithArguments("1", "char", "params string").WithLocation(5, 7),
651
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(19, 7),
729
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(19, 14),
787
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(19, 14),
1141
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(21, 14),
1206
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(26, 14),
1325
Diagnostic(ErrorCode.
ERR_BadArgType
, "3").WithArguments("2", "int", "string").WithLocation(19, 19),
1340
Diagnostic(ErrorCode.
ERR_BadArgType
, "3").WithArguments("1", "int", "string").WithLocation(23, 14),
1395
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(17, 7),
1473
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(19, 14),
1522
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(19, 14),
1608
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(16, 14),
1656
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(18, 14),
1746
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(21, 14),
1799
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(23, 14),
1853
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(24, 14),
2154
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(18, 14),
2466
Diagnostic(ErrorCode.
ERR_BadArgType
, "3").WithArguments("2", "int", "string").WithLocation(16, 19),
2519
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params MyCollection").WithLocation(15, 7),
2655
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params System.Collections.Generic." + @interface + "<long>").WithLocation(7, 7),
2716
Diagnostic(ErrorCode.
ERR_BadArgType
, "new object()").WithArguments("1", "object", "params System.Collections.IEnumerable").WithLocation(7, 14)
4033
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params System.ReadOnlySpan<long>").WithLocation(6, 22),
4100
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "scoped System.ReadOnlySpan<long>").WithLocation(9, 12),
5524
Diagnostic(ErrorCode.
ERR_BadArgType
, "new[] { default }").WithArguments("1", "?[]", "int").WithLocation(5, 19),
6446
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("2", "int", "byte").WithLocation(21, 19),
6449
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("3", "int", "byte").WithLocation(21, 22)
7481
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("2", "int", "byte").WithLocation(19, 29),
7484
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("3", "int", "byte").WithLocation(19, 32)
8085
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("2", "int", "byte").WithLocation(19, 23),
8088
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("3", "int", "byte").WithLocation(19, 26)
10800
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params System.Collections.Generic.IEnumerable<long>").WithLocation(6, 22),
10803
Diagnostic(ErrorCode.
ERR_BadArgType
, "2").WithArguments("1", "int", "params long[]").WithLocation(7, 22)
11387
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params System.Collections.Generic.IEnumerable<long>").WithLocation(6, 27),
11390
Diagnostic(ErrorCode.
ERR_BadArgType
, "2").WithArguments("1", "int", "params long[]").WithLocation(7, 27)
11970
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params System.Collections.Generic.IEnumerable<long>").WithLocation(6, 23),
11973
Diagnostic(ErrorCode.
ERR_BadArgType
, "2").WithArguments("1", "int", "params long[]").WithLocation(7, 23)
12448
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params long[]").WithLocation(6, 27),
12451
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params long[]").WithLocation(7, 23)
12459
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params System.Collections.Generic.IEnumerable<long>").WithLocation(6, 27),
12462
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params System.Collections.Generic.IEnumerable<long>").WithLocation(7, 23)
14452
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params System.Runtime.CompilerServices.CollectionBuilderAttribute").WithLocation(26, 18),
14506
Diagnostic(ErrorCode.
ERR_BadArgType
, "nameof(MyCollectionBuilder.Create)").WithArguments("2", "string", "params System.Runtime.CompilerServices.CollectionBuilderAttribute").WithLocation(9, 53),
14515
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""1""").WithArguments("1", "string", "params System.Runtime.CompilerServices.CollectionBuilderAttribute").WithLocation(26, 18),
16324
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""a""").WithArguments("1", "string", "object[]").WithLocation(5, 14)
16361
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "int", "params MyCollection<object>").WithLocation(19, 14)
Semantics\PatternMatchingTests_ListPatterns.cs (46)
1132
Diagnostic(ErrorCode.
ERR_BadArgType
, ".. var slice").WithArguments("1", "System.Range", "int").WithLocation(6, 19),
1138
Diagnostic(ErrorCode.
ERR_BadArgType
, "..").WithArguments("1", "System.Range", "int").WithLocation(7, 15)
1909
Diagnostic(ErrorCode.
ERR_BadArgType
, "[0]").WithArguments("1", "System.Index", "int").WithLocation(4, 20),
1912
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int").WithLocation(5, 17)
1935
Diagnostic(ErrorCode.
ERR_BadArgType
, "[0]").WithArguments("1", "System.Index", "long").WithLocation(4, 20),
1938
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "long").WithLocation(5, 17)
1961
Diagnostic(ErrorCode.
ERR_BadArgType
, "[0]").WithArguments("1", "System.Index", "long").WithLocation(4, 20),
1964
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "long").WithLocation(5, 17)
1987
Diagnostic(ErrorCode.
ERR_BadArgType
, "[0]").WithArguments("1", "System.Index", "int").WithLocation(4, 20),
1990
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int").WithLocation(5, 17)
2097
Diagnostic(ErrorCode.
ERR_BadArgType
, "..var p").WithArguments("1", "System.Range", "int").WithLocation(4, 21),
2100
Diagnostic(ErrorCode.
ERR_BadArgType
, "..").WithArguments("1", "System.Range", "int").WithLocation(6, 17)
2125
Diagnostic(ErrorCode.
ERR_BadArgType
, "..var p").WithArguments("1", "System.Range", "int").WithLocation(4, 21),
2128
Diagnostic(ErrorCode.
ERR_BadArgType
, "..").WithArguments("1", "System.Range", "int").WithLocation(6, 17)
2153
Diagnostic(ErrorCode.
ERR_BadArgType
, "..var p").WithArguments("1", "System.Range", "int").WithLocation(4, 21),
2156
Diagnostic(ErrorCode.
ERR_BadArgType
, "..").WithArguments("1", "System.Range", "int").WithLocation(6, 17)
2181
Diagnostic(ErrorCode.
ERR_BadArgType
, "..var p").WithArguments("1", "System.Range", "int").WithLocation(4, 21),
2184
Diagnostic(ErrorCode.
ERR_BadArgType
, "..").WithArguments("1", "System.Range", "int").WithLocation(6, 17)
2209
Diagnostic(ErrorCode.
ERR_BadArgType
, "..var p").WithArguments("1", "System.Range", "int").WithLocation(4, 21),
2212
Diagnostic(ErrorCode.
ERR_BadArgType
, "..").WithArguments("1", "System.Range", "int").WithLocation(6, 17)
2237
Diagnostic(ErrorCode.
ERR_BadArgType
, "..var p").WithArguments("1", "System.Range", "int").WithLocation(4, 21),
2240
Diagnostic(ErrorCode.
ERR_BadArgType
, "..").WithArguments("1", "System.Range", "int").WithLocation(6, 17)
3840
Diagnostic(ErrorCode.
ERR_BadArgType
, "[1]").WithArguments("1", "System.Index", "int").WithLocation(8, 21),
3843
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int").WithLocation(9, 18)
3870
Diagnostic(ErrorCode.
ERR_BadArgType
, "[1]").WithArguments("1", "System.Index", "int").WithLocation(9, 21),
3873
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int").WithLocation(10, 18)
3928
Diagnostic(ErrorCode.
ERR_BadArgType
, ".._").WithArguments("1", "System.Range", "int").WithLocation(11, 22),
3931
Diagnostic(ErrorCode.
ERR_BadArgType
, "..var unused").WithArguments("1", "System.Range", "int").WithLocation(12, 22),
3934
Diagnostic(ErrorCode.
ERR_BadArgType
, "..var used").WithArguments("1", "System.Range", "int").WithLocation(13, 22),
3937
Diagnostic(ErrorCode.
ERR_BadArgType
, "..").WithArguments("1", "System.Range", "int").WithLocation(17, 18)
3999
Diagnostic(ErrorCode.
ERR_BadArgType
, "[var item]").WithArguments("1", "System.Index", "int").WithLocation(10, 29),
4002
Diagnostic(ErrorCode.
ERR_BadArgType
, "[var item2]").WithArguments("1", "System.Index", "int?").WithLocation(13, 30),
4008
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int?").WithLocation(15, 36),
5496
Diagnostic(ErrorCode.
ERR_BadArgType
, "[var item, ..var rest]").WithArguments("1", "System.Index", "in int").WithLocation(10, 21),
5502
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "in int").WithLocation(11, 18),
5738
Diagnostic(ErrorCode.
ERR_BadArgType
, "..var y").WithArguments("1", "System.Range", "int").WithLocation(2, 17),
5741
Diagnostic(ErrorCode.
ERR_BadArgType
, "..").WithArguments("1", "System.Range", "int").WithLocation(3, 13)
6151
Diagnostic(ErrorCode.
ERR_BadArgType
, "[..]").WithArguments("1", "System.Index", "int").WithLocation(4, 5),
6154
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int").WithLocation(7, 13)
6181
Diagnostic(ErrorCode.
ERR_BadArgType
, "[..]").WithArguments("1", "System.Index", "int").WithLocation(4, 5),
6184
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int").WithLocation(7, 13)
7835
Diagnostic(ErrorCode.
ERR_BadArgType
, "[]").WithArguments("1", "System.Index", "int").WithLocation(2, 16),
7838
Diagnostic(ErrorCode.
ERR_BadArgType
, "^1").WithArguments("1", "System.Index", "int").WithLocation(3, 13)
8573
Diagnostic(ErrorCode.
ERR_BadArgType
, "..var y2").WithArguments("1", "System.Range", "int").WithLocation(6, 16)
8655
Diagnostic(ErrorCode.
ERR_BadArgType
, "[]").WithArguments("1", "System.Index", "int").WithLocation(2, 16)
8818
Diagnostic(ErrorCode.
ERR_BadArgType
, "[]").WithArguments("1", "System.Index", "int").WithLocation(2, 16)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (7)
IOperation\FunctionPointerOperations.cs (1)
368
Diagnostic(ErrorCode.
ERR_BadArgType
, "Prop").WithArguments("1", "string", "int").WithLocation(7, 23)
IOperation\IOperationTests.cs (1)
409
Diagnostic(ErrorCode.
ERR_BadArgType
, "new object()").WithArguments("1", "object", "int").WithLocation(7, 15)
IOperation\IOperationTests_IArgument.cs (2)
1351
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "string").WithLocation(6, 22)
3758
Diagnostic(ErrorCode.
ERR_BadArgType
, "0").WithArguments("1", "int", "string").WithLocation(13, 37)
IOperation\IOperationTests_IAttributeOperation.cs (1)
291
Diagnostic(ErrorCode.
ERR_BadArgType
, "0").WithArguments("1", "int", "string").WithLocation(9, 15)
IOperation\IOperationTests_IIsPatternExpression.cs (1)
2401
Diagnostic(ErrorCode.
ERR_BadArgType
, ".. 0").WithArguments("1", "System.Range", "int").WithLocation(9, 32)
IOperation\IOperationTests_InvalidExpression.cs (1)
76
Diagnostic(ErrorCode.
ERR_BadArgType
, "string.Empty").WithArguments("1", "string", "int").WithLocation(8, 21)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (306)
Semantics\ArglistTests.cs (2)
558
Diagnostic(ErrorCode.
ERR_BadArgType
, "3").WithArguments("2", "int", "__arglist").WithLocation(12, 14),
573
Diagnostic(ErrorCode.
ERR_BadArgType
, "__arglist(1)").WithArguments("1", "__arglist", "int").WithLocation(24, 11),
Semantics\BindingTests.cs (11)
252
Diagnostic(ErrorCode.
ERR_BadArgType
, "a.E").WithArguments("1", "method group", "A").WithLocation(14, 15),
324
Diagnostic(ErrorCode.
ERR_BadArgType
, "a.F").WithArguments("1", "method group", "System.Action").WithLocation(18, 12),
361
Diagnostic(ErrorCode.
ERR_BadArgType
, "o").WithArguments("1", "object", "string").WithLocation(20, 13));
615
Diagnostic(ErrorCode.
ERR_BadArgType
, "2.0").WithArguments("2", "double", "A").WithLocation(13, 18));
637
Diagnostic(ErrorCode.
ERR_BadArgType
, "o").WithArguments("1", "object", "int").WithLocation(6, 11),
639
Diagnostic(ErrorCode.
ERR_BadArgType
, "o").WithArguments("2", "object", "int").WithLocation(7, 14),
641
Diagnostic(ErrorCode.
ERR_BadArgType
, "o").WithArguments("3", "object", "int").WithLocation(8, 17));
666
Diagnostic(ErrorCode.
ERR_BadArgType
, "o").WithArguments("1", "object", "int").WithLocation(6, 19),
669
Diagnostic(ErrorCode.
ERR_BadArgType
, "o").WithArguments("2", "object", "int").WithLocation(7, 22),
672
Diagnostic(ErrorCode.
ERR_BadArgType
, "o").WithArguments("3", "object", "int").WithLocation(8, 25)
694
Diagnostic(ErrorCode.
ERR_BadArgType
, "1.0").WithArguments("1", "double", "int").WithLocation(8, 11));
Semantics\ColorColorTests.cs (1)
1154
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""Hello""").WithArguments("1", "string", "int"));
Semantics\DeconstructionTests.cs (1)
369
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "out long", "out int").WithLocation(10, 27)
Semantics\DelegateTypeTests.cs (9)
4962
Diagnostic(ErrorCode.
ERR_BadArgType
, "F2").WithArguments("1", "method group", "System.Delegate").WithLocation(14, 12),
4965
Diagnostic(ErrorCode.
ERR_BadArgType
, "F1").WithArguments("1", "method group", "System.Delegate").WithLocation(15, 12),
5176
Diagnostic(ErrorCode.
ERR_BadArgType
, "M1").WithArguments("1", "method group", "System.Delegate").WithLocation(10, 12),
5188
Diagnostic(ErrorCode.
ERR_BadArgType
, "M1").WithArguments("1", "method group", "System.Delegate").WithLocation(10, 12),
6000
Diagnostic(ErrorCode.
ERR_BadArgType
, "Main").WithArguments("1", "method group", "System.Delegate").WithLocation(8, 11),
6032
Diagnostic(ErrorCode.
ERR_BadArgType
, "Main").WithArguments("1", "method group", "object").WithLocation(8, 11),
6105
Diagnostic(ErrorCode.
ERR_BadArgType
, "F").WithArguments("1", "method group", "System.Linq.Expressions.Expression").WithLocation(10, 11));
6168
Diagnostic(ErrorCode.
ERR_BadArgType
, "F").WithArguments("1", "method group", "System.Linq.Expressions.Expression").WithLocation(10, 11),
17135
Diagnostic(ErrorCode.
ERR_BadArgType
, "f").WithArguments("1", "<anonymous delegate>", "System.Func<int, int>").WithLocation(15, 24));
Semantics\DynamicTests.cs (7)
207
Diagnostic(ErrorCode.
ERR_BadArgType
, "d").WithArguments("1", "dynamic", "__arglist"));
1823
Diagnostic(ErrorCode.
ERR_BadArgType
, "u").WithArguments("3", "U", "T"));
1845
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(R)").WithArguments("2", "R", "S"));
2338
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "System.Action<D<object>.E*[]>"));
3515
Diagnostic(ErrorCode.
ERR_BadArgType
, "1.23").WithArguments("2", "double", "int"));
3535
Diagnostic(ErrorCode.
ERR_BadArgType
, "1.23").WithArguments("2", "double", "int"));
3715
Diagnostic(ErrorCode.
ERR_BadArgType
, "new C(d)").WithArguments("1", "C", "int"));
Semantics\FunctionPointerTests.cs (15)
2856
Diagnostic(ErrorCode.
ERR_BadArgType
, "&converter").WithArguments("2", "&method group", "System.Func<string, int>").WithLocation(7, 38),
2859
Diagnostic(ErrorCode.
ERR_BadArgType
, "&converter").WithArguments("2", "&method group", "System.Func<string, int>").WithLocation(8, 27)
2886
Diagnostic(ErrorCode.
ERR_BadArgType
, "ptr1").WithArguments("1", "delegate*<string, void>[]", "delegate* unmanaged<string, void>[]").WithLocation(6, 19),
2892
Diagnostic(ErrorCode.
ERR_BadArgType
, "ptr2").WithArguments("1", "delegate* unmanaged[Cdecl, Stdcall]<string, void>[]", "delegate* unmanaged<string, void>[]").WithLocation(9, 19)
2919
Diagnostic(ErrorCode.
ERR_BadArgType
, "ptr1").WithArguments("1", "delegate*<ref string, string>[]", "delegate*<string, string>[]").WithLocation(6, 27),
2925
Diagnostic(ErrorCode.
ERR_BadArgType
, "ptr2").WithArguments("1", "delegate*<string, ref string>[]", "delegate*<string, string>[]").WithLocation(9, 27)
2984
Diagnostic(ErrorCode.
ERR_BadArgType
, "ptr").WithArguments("1", "delegate*<int, string>", "delegate* unmanaged[Cdecl]<int, string>").WithLocation(6, 23)
3011
Diagnostic(ErrorCode.
ERR_BadArgType
, "ptr1").WithArguments("1", "delegate*<ref string, string>", "delegate*<string, string>").WithLocation(6, 26),
3017
Diagnostic(ErrorCode.
ERR_BadArgType
, "ptr2").WithArguments("1", "delegate*<string, ref string>", "delegate*<string, string>").WithLocation(9, 26)
3041
Diagnostic(ErrorCode.
ERR_BadArgType
, "ptr").WithArguments("1", "delegate*<delegate*<string, string>, void>", "delegate*<delegate* unmanaged[Cdecl]<string, string>, void>").WithLocation(6, 26)
3068
Diagnostic(ErrorCode.
ERR_BadArgType
, "ptr1").WithArguments("1", "delegate*<delegate*<ref string, string>, void>", "delegate*<delegate*<string, string>, void>").WithLocation(6, 26),
3074
Diagnostic(ErrorCode.
ERR_BadArgType
, "ptr2").WithArguments("1", "delegate*<delegate*<string, ref string>, void>", "delegate*<delegate*<string, string>, void>").WithLocation(9, 26)
3924
Diagnostic(ErrorCode.
ERR_BadArgType
, "__arglist(string.Empty, 1)").WithArguments("1", "__arglist", "string").WithLocation(6, 14),
3927
Diagnostic(ErrorCode.
ERR_BadArgType
, "__arglist(string.Empty, 1)").WithArguments("2", "__arglist", "int").WithLocation(7, 20),
3933
Diagnostic(ErrorCode.
ERR_BadArgType
, "__arglist(1, 2, 3, ptr1)").WithArguments("1", "__arglist", "?").WithLocation(9, 14)
Semantics\HideByNameTests.cs (3)
74
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""""").WithArguments("1", "string", "int"));
130
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""""").WithArguments("1", "string", "int"));
450
Diagnostic(ErrorCode.
ERR_BadArgType
, "0").WithArguments("1", "int", "string"));
Semantics\IndexAndRangeTests.cs (20)
43
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""str2""").WithArguments("1", "string", "int").WithLocation(7, 19),
46
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "int").WithLocation(8, 19),
49
Diagnostic(ErrorCode.
ERR_BadArgType
, "Main()").WithArguments("1", "void", "int").WithLocation(9, 19),
52
Diagnostic(ErrorCode.
ERR_BadArgType
, "new object()").WithArguments("1", "object", "int").WithLocation(10, 19),
315
Diagnostic(ErrorCode.
ERR_BadArgType
, "^0").WithArguments("1", "System.Index", "int").WithLocation(12, 15),
318
Diagnostic(ErrorCode.
ERR_BadArgType
, "0..").WithArguments("1", "System.Range", "int").WithLocation(13, 15)
344
Diagnostic(ErrorCode.
ERR_BadArgType
, "^0").WithArguments("1", "System.Index", "int").WithLocation(12, 15),
347
Diagnostic(ErrorCode.
ERR_BadArgType
, "0..").WithArguments("1", "System.Range", "int").WithLocation(13, 15)
373
Diagnostic(ErrorCode.
ERR_BadArgType
, "^0").WithArguments("1", "System.Index", "int").WithLocation(12, 15),
376
Diagnostic(ErrorCode.
ERR_BadArgType
, "0..").WithArguments("1", "System.Range", "int").WithLocation(13, 15)
405
Diagnostic(ErrorCode.
ERR_BadArgType
, "0..").WithArguments("1", "System.Range", "int").WithLocation(13, 15)
431
Diagnostic(ErrorCode.
ERR_BadArgType
, "^0").WithArguments("1", "System.Index", "int").WithLocation(12, 15),
434
Diagnostic(ErrorCode.
ERR_BadArgType
, "0..").WithArguments("1", "System.Range", "int").WithLocation(13, 15)
560
Diagnostic(ErrorCode.
ERR_BadArgType
, "^0").WithArguments("1", "System.Index", "int").WithLocation(9, 18),
563
Diagnostic(ErrorCode.
ERR_BadArgType
, "0..").WithArguments("1", "System.Range", "int").WithLocation(10, 18));
598
Diagnostic(ErrorCode.
ERR_BadArgType
, "^0").WithArguments("1", "System.Index", "int").WithLocation(19, 16),
601
Diagnostic(ErrorCode.
ERR_BadArgType
, "0..").WithArguments("1", "System.Range", "int").WithLocation(20, 16),
604
Diagnostic(ErrorCode.
ERR_BadArgType
, "^0").WithArguments("1", "System.Index", "int").WithLocation(23, 16),
607
Diagnostic(ErrorCode.
ERR_BadArgType
, "0..").WithArguments("1", "System.Range", "int").WithLocation(24, 16));
778
Diagnostic(ErrorCode.
ERR_BadArgType
, "^0").WithArguments("1", "System.Index", "in int[]").WithLocation(7, 11),
Semantics\InterceptorsTests.cs (1)
3005
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""10""").WithArguments("3", "string", "int").WithLocation(6, 42),
Semantics\InterpolationTests.cs (9)
3746
Diagnostic(ErrorCode.
ERR_BadArgType
, "(null, default)").WithArguments("1", "(<null>, default)", "object").WithLocation(1, 29),
4212
Diagnostic(ErrorCode.
ERR_BadArgType
, "Text").WithArguments("1", "string", "CustomStruct").WithLocation(4, 21)
6890
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "string").WithLocation(8, 70)
8246
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("3", "int", "string").WithLocation(1, 5)
8252
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("3", "int", "string").WithLocation(1, 5),
13741
Diagnostic(ErrorCode.
ERR_BadArgType
, @"$""{1}"" + $""literal""").WithArguments("1", "string", "System.FormattableString").WithLocation(2, 3),
13763
Diagnostic(ErrorCode.
ERR_BadArgType
, @"$""{1}"" + $""literal""").WithArguments("1", "string", "System.IFormattable").WithLocation(2, 3),
18503
Diagnostic(ErrorCode.
ERR_BadArgType
, "s").WithArguments("1", "string", "System.Runtime.CompilerServices.DefaultInterpolatedStringHandler").WithLocation(5, 15),
18509
Diagnostic(ErrorCode.
ERR_BadArgType
, "s").WithArguments("1", "string", "in System.Runtime.CompilerServices.DefaultInterpolatedStringHandler").WithLocation(7, 14));
Semantics\IteratorTests.cs (1)
741
Diagnostic(ErrorCode.
ERR_BadArgType
, "kvp").WithArguments("1", "System.Collections.Generic.KeyValuePair<TKey, TValue>", "TKey").WithLocation(8, 53)
Semantics\LocalFunctionTests.cs (7)
2815
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref dynamic", "ref int").WithLocation(9, 20),
10010
Diagnostic(ErrorCode.
ERR_BadArgType
, "local").WithArguments("1", "method group", "string").WithLocation(8, 36),
10013
Diagnostic(ErrorCode.
ERR_BadArgType
, "M2").WithArguments("1", "method group", "string").WithLocation(11, 29)
10065
Diagnostic(ErrorCode.
ERR_BadArgType
, "local").WithArguments("1", "method group", "string").WithLocation(8, 24),
10068
Diagnostic(ErrorCode.
ERR_BadArgType
, "M2").WithArguments("1", "method group", "string").WithLocation(11, 17)
10122
Diagnostic(ErrorCode.
ERR_BadArgType
, "local").WithArguments("1", "method group", "string").WithLocation(8, 13),
10125
Diagnostic(ErrorCode.
ERR_BadArgType
, "M2").WithArguments("1", "method group", "string").WithLocation(12, 9)
Semantics\MethodTypeInferenceTests.cs (1)
896
Diagnostic(ErrorCode.
ERR_BadArgType
, "345").WithArguments("2", "int", "?"));
Semantics\MultiDimensionalArrayTests.cs (5)
485
Diagnostic(ErrorCode.
ERR_BadArgType
, "a4").WithArguments("1", "double[]", "double[*]").WithLocation(10, 17),
567
Diagnostic(ErrorCode.
ERR_BadArgType
, "sz").WithArguments("2", "double[]", "double[*]").WithLocation(20, 21),
570
Diagnostic(ErrorCode.
ERR_BadArgType
, "md").WithArguments("1", "double[*]", "double[]").WithLocation(21, 17),
750
Diagnostic(ErrorCode.
ERR_BadArgType
, "d").WithArguments("1", "double", "params double[*]").WithLocation(7, 17),
753
Diagnostic(ErrorCode.
ERR_BadArgType
, "new double [] {d}").WithArguments("1", "double[]", "params double[*]").WithLocation(8, 17)
Semantics\NameOfTests.cs (1)
1547
Diagnostic(ErrorCode.
ERR_BadArgType
, "myStruct.MessageType").WithArguments("1", "char*", "char[]").WithLocation(26, 23));
Semantics\NativeIntegerTests.cs (12)
6849
Diagnostic(ErrorCode.
ERR_BadArgType
, "sbyte.MaxValue").WithArguments("1", "sbyte", "ushort").WithLocation(5, 19),
6852
Diagnostic(ErrorCode.
ERR_BadArgType
, "short.MaxValue").WithArguments("1", "short", "ushort").WithLocation(6, 19),
6855
Diagnostic(ErrorCode.
ERR_BadArgType
, "int.MaxValue").WithArguments("1", "int", "ushort").WithLocation(7, 19),
6858
Diagnostic(ErrorCode.
ERR_BadArgType
, "long.MaxValue").WithArguments("1", "long", "ushort").WithLocation(8, 19),
6861
Diagnostic(ErrorCode.
ERR_BadArgType
, "sbyte.MaxValue").WithArguments("1", "sbyte", "uint").WithLocation(9, 17),
6864
Diagnostic(ErrorCode.
ERR_BadArgType
, "short.MaxValue").WithArguments("1", "short", "uint").WithLocation(10, 17),
6867
Diagnostic(ErrorCode.
ERR_BadArgType
, "long.MaxValue").WithArguments("1", "long", "uint").WithLocation(12, 17),
6870
Diagnostic(ErrorCode.
ERR_BadArgType
, "sbyte.MaxValue").WithArguments("1", "sbyte", "nuint").WithLocation(13, 18),
6873
Diagnostic(ErrorCode.
ERR_BadArgType
, "short.MaxValue").WithArguments("1", "short", "nuint").WithLocation(14, 18),
6876
Diagnostic(ErrorCode.
ERR_BadArgType
, "long.MaxValue").WithArguments("1", "long", "nuint").WithLocation(16, 18),
6879
Diagnostic(ErrorCode.
ERR_BadArgType
, "sbyte.MaxValue").WithArguments("1", "sbyte", "ulong").WithLocation(17, 18),
6882
Diagnostic(ErrorCode.
ERR_BadArgType
, "short.MaxValue").WithArguments("1", "short", "ulong").WithLocation(18, 18));
Semantics\NonTrailingNamedArgumentsTests.cs (1)
647
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params int[]").WithLocation(9, 14)
Semantics\NullableReferenceTypesTests.cs (10)
2010
Diagnostic(ErrorCode.
ERR_BadArgType
, "a.E").WithArguments("1", "method group", "A").WithLocation(11, 15),
2031
Diagnostic(ErrorCode.
ERR_BadArgType
, "a.F").WithArguments("1", "method group", "A").WithLocation(20, 15),
38280
Diagnostic(ErrorCode.
ERR_BadArgType
, "M2(null)").WithArguments("1", "void", "string").WithLocation(6, 35),
47132
Diagnostic(ErrorCode.
ERR_BadArgType
, "s18").WithArguments("2", "ref T", "ref T?").WithLocation(90, 20),
47144
Diagnostic(ErrorCode.
ERR_BadArgType
, "s20").WithArguments("2", "ref T", "ref T?").WithLocation(99, 20),
78322
Diagnostic(ErrorCode.
ERR_BadArgType
, "class3").WithArguments("1", "ConsoleApp1.Class3<ConsoleApp1.Class2>", "ConsoleApp1.Class3<ConsoleApp1.IClass2>").WithLocation(26, 20),
78481
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("2", "<null>", "int").WithLocation(14, 29),
80928
Diagnostic(ErrorCode.
ERR_BadArgType
, "F").WithArguments("1", "method group", "object").WithLocation(5, 11),
130500
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "S").WithLocation(16, 32),
130506
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "S").WithLocation(19, 32),
Semantics\ObjectAndCollectionInitializerTests.cs (2)
2422
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""hi""").WithArguments("1", "string", "int").WithLocation(14, 49)
2754
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "string").WithLocation(10, 27),
Semantics\OverloadResolutionTests.cs (113)
309
Diagnostic(ErrorCode.
ERR_BadArgType
, "ni").WithArguments("1", "int?", "int"),
312
Diagnostic(ErrorCode.
ERR_BadArgType
, "ns").WithArguments("1", "short?", "int"),
315
Diagnostic(ErrorCode.
ERR_BadArgType
, "nu").WithArguments("1", "uint?", "int?")
1347
Diagnostic(ErrorCode.
ERR_BadArgType
, "x => x").WithArguments("1", "lambda expression", "ref System.Func<string, string>").WithLocation(14, 21),
1350
Diagnostic(ErrorCode.
ERR_BadArgType
, "x => x").WithArguments("1", "lambda expression", "out System.Func<string, string>").WithLocation(15, 21),
1353
Diagnostic(ErrorCode.
ERR_BadArgType
, "x => x").WithArguments("1", "lambda expression", "ref System.Linq.Expressions.Expression<System.Func<string, string>>").WithLocation(16, 22),
1356
Diagnostic(ErrorCode.
ERR_BadArgType
, "x => x").WithArguments("1", "lambda expression", "out System.Linq.Expressions.Expression<System.Func<string, string>>").WithLocation(17, 22));
1549
Diagnostic(ErrorCode.
ERR_BadArgType
, "VoidReturning()").WithArguments("1", "void", "bool").WithLocation(8, 34));
3063
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "short", "sbyte"),
3072
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "short", "sbyte"),
3081
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "short", "sbyte"),
3715
Diagnostic(ErrorCode.
ERR_BadArgType
, "10L").WithArguments("1", "long", "int"),
3718
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "int"),
3733
Diagnostic(ErrorCode.
ERR_BadArgType
, "10L").WithArguments("1", "long", "char"),
3736
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "char"),
3769
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref int"),
3778
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref int", "ref char"),
3781
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref int", "ref long"),
3784
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref long"),
3787
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref int", "ref long"),
3790
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref long"),
3793
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref int", "ref char"),
3796
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "ref long", "ref char"));
5123
Diagnostic(ErrorCode.
ERR_BadArgType
, "10L").WithArguments("1", "long", "int"),
5126
Diagnostic(ErrorCode.
ERR_BadArgType
, "10L").WithArguments("1", "long", "int"),
5129
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "int"),
5132
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "int"),
5159
Diagnostic(ErrorCode.
ERR_BadArgType
, "10L").WithArguments("1", "long", "char"),
5162
Diagnostic(ErrorCode.
ERR_BadArgType
, "10L").WithArguments("1", "long", "char"),
5165
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "char"),
5168
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "char"),
5207
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref long"),
5210
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref long"),
5225
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref int", "ref long"),
5228
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref int", "ref long"),
5231
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref int", "ref long"),
5234
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref int", "ref long"),
5237
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref long"),
5240
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref long"),
5243
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref int", "ref long"),
5246
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref int", "ref long"),
5249
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref long"),
5252
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref long"),
5909
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "int"),
5912
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "int"),
5915
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "int"),
5939
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
5942
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "int"),
5945
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("2", "int", "char"),
5948
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "int"),
5951
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
5954
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "long", "int"),
5957
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
5963
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
5969
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("2", "int", "char"),
5975
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
5984
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("2", "int", "char"),
5990
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
5996
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
6002
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
6005
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
6008
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("2", "int", "char"),
6011
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
6014
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "ref long", "ref int"),
6017
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
6020
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref int"),
6023
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("2", "int", "char"),
6026
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref int"),
6029
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
6032
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref char", "ref int"),
6074
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
6080
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
6083
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
6086
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("2", "int", "char"),
6089
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
6092
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "ref long", "ref int"),
6095
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "char"),
6101
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "int"),
6110
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "int"),
6116
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "int"),
6122
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "int"),
6125
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("1", "ref long", "ref int"),
6128
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "long", "int"),
6179
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "ref long", "ref int"),
6182
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "ref long", "ref int"),
6185
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "ref long", "ref int"),
6212
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "ref long", "ref int"),
6221
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "ref long", "ref int"),
6239
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "ref long", "ref int"),
6245
Diagnostic(ErrorCode.
ERR_BadArgType
, "i").WithArguments("1", "ref int", "ref long"),
6248
Diagnostic(ErrorCode.
ERR_BadArgType
, "l").WithArguments("2", "ref long", "ref int"));
6285
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("2", "<null>", "int"),
6288
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "int"),
6291
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("2", "<null>", "int"),
6294
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "int"),
6297
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""A""").WithArguments("2", "string", "int"),
6300
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "string"),
6303
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""A""").WithArguments("2", "string", "int"),
6306
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "string"));
7556
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""aaa""").WithArguments("1", "string", "int").WithLocation(8, 46)
8380
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "params int[]").WithLocation(12, 13));
9337
Diagnostic(ErrorCode.
ERR_BadArgType
, "a").WithArguments("3", "A", "B").WithLocation(9, 22));
9834
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(object)").WithArguments("1", "object", "string").WithLocation(8, 37));
9865
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(object)").WithArguments("1", "object", "string").WithLocation(8, 15));
9944
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "System.Exception", "in int").WithLocation(11, 16),
9950
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "in System.Exception", "in int").WithLocation(13, 19),
9959
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "System.Exception", "in int").WithLocation(11, 16),
9962
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "ref System.Exception", "in int").WithLocation(12, 20),
9965
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "in System.Exception", "in int").WithLocation(13, 19),
10821
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "in byte", "in int").WithLocation(17, 19),
10918
Diagnostic(ErrorCode.
ERR_BadArgType
, "x").WithArguments("1", "in byte", "in int").WithLocation(27, 18),
11305
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "in int").WithLocation(16, 12),
11400
Diagnostic(ErrorCode.
ERR_BadArgType
, "(null, 1)").WithArguments("1", "(<null>, int)", "in (int arg1, int arg2)").WithLocation(16, 16),
Semantics\RawInterpolationTests_Handler.cs (8)
2128
Diagnostic(ErrorCode.
ERR_BadArgType
, "(null, default)").WithArguments("1", "(<null>, default)", "object").WithLocation(1, 31),
2147
Diagnostic(ErrorCode.
ERR_BadArgType
, "(null, default)").WithArguments("1", "(<null>, default)", "object").WithLocation(1, 31),
2613
Diagnostic(ErrorCode.
ERR_BadArgType
, "Text").WithArguments("1", "string", "CustomStruct").WithLocation(4, 23));
5150
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "string").WithLocation(expression.Contains('+') ? 12 : 10, 70));
6417
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("3", "int", "string").WithLocation(1, 5)
6423
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("3", "int", "string").WithLocation(1, 5),
10342
Diagnostic(ErrorCode.
ERR_BadArgType
, @"$""""""{1}"""""" + $""""""literal""""""").WithArguments("1", "string", "System.FormattableString").WithLocation(2, 3),
10363
Diagnostic(ErrorCode.
ERR_BadArgType
, @"$""""""{1}"""""" + $""""""literal""""""").WithArguments("1", "string", "System.IFormattable").WithLocation(2, 3),
Semantics\RefLocalsAndReturnsTests.cs (1)
218
Diagnostic(ErrorCode.
ERR_BadArgType
, "rs = ref s").WithArguments("1", "in string", "in object").WithLocation(7, 16));
Semantics\SemanticAnalyzerTests.cs (31)
488
Diagnostic(ErrorCode.
ERR_BadArgType
, "123.456").WithArguments("1", "double", "int").WithLocation(165, 24),
497
Diagnostic(ErrorCode.
ERR_BadArgType
, "1234.4567").WithArguments("3", "double", "int").WithLocation(178, 40),
500
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "ref int").WithLocation(184, 30),
503
Diagnostic(ErrorCode.
ERR_BadArgType
, "p.ToString").WithArguments("2", "method group", "ref int").WithLocation(184, 36),
618
Diagnostic(ErrorCode.
ERR_BadArgType
, "B.T").WithArguments("1", "method group", "int").WithLocation(45, 11),
621
Diagnostic(ErrorCode.
ERR_BadArgType
, "B.U").WithArguments("1", "method group", "int").WithLocation(46, 11),
624
Diagnostic(ErrorCode.
ERR_BadArgType
, "b.V").WithArguments("1", "method group", "int").WithLocation(47, 11),
627
Diagnostic(ErrorCode.
ERR_BadArgType
, "b.W").WithArguments("1", "method group", "int").WithLocation(48, 11),
1008
Diagnostic(ErrorCode.
ERR_BadArgType
, "false").WithArguments("1", "bool", "E").WithLocation(10, 11),
1011
Diagnostic(ErrorCode.
ERR_BadArgType
, "(char)(One - 1)").WithArguments("1", "char", "E").WithLocation(11, 11),
1014
Diagnostic(ErrorCode.
ERR_BadArgType
, "(F)(One - 1)").WithArguments("1", "F", "E").WithLocation(24, 11),
1017
Diagnostic(ErrorCode.
ERR_BadArgType
, "Null").WithArguments("1", "object", "E").WithLocation(25, 11),
1020
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "E").WithLocation(26, 11),
1023
Diagnostic(ErrorCode.
ERR_BadArgType
, "F.Zero").WithArguments("1", "F", "E").WithLocation(29, 11),
1026
Diagnostic(ErrorCode.
ERR_BadArgType
, "true").WithArguments("1", "bool", "E").WithLocation(31, 11),
1029
Diagnostic(ErrorCode.
ERR_BadArgType
, "(char)One").WithArguments("1", "char", "E").WithLocation(32, 11),
1032
Diagnostic(ErrorCode.
ERR_BadArgType
, "(sbyte)One").WithArguments("1", "sbyte", "E").WithLocation(33, 11),
1035
Diagnostic(ErrorCode.
ERR_BadArgType
, "(byte)One").WithArguments("1", "byte", "E").WithLocation(34, 11),
1038
Diagnostic(ErrorCode.
ERR_BadArgType
, "(short)One").WithArguments("1", "short", "E").WithLocation(35, 11),
1041
Diagnostic(ErrorCode.
ERR_BadArgType
, "(ushort)One").WithArguments("1", "ushort", "E").WithLocation(36, 11),
1044
Diagnostic(ErrorCode.
ERR_BadArgType
, "(int)One").WithArguments("1", "int", "E").WithLocation(37, 11),
1047
Diagnostic(ErrorCode.
ERR_BadArgType
, "(uint)One").WithArguments("1", "uint", "E").WithLocation(38, 11),
1050
Diagnostic(ErrorCode.
ERR_BadArgType
, "(long)One").WithArguments("1", "long", "E").WithLocation(39, 11),
1053
Diagnostic(ErrorCode.
ERR_BadArgType
, "(ulong)One").WithArguments("1", "ulong", "E").WithLocation(40, 11),
1056
Diagnostic(ErrorCode.
ERR_BadArgType
, "(decimal)One").WithArguments("1", "decimal", "E").WithLocation(41, 11),
1059
Diagnostic(ErrorCode.
ERR_BadArgType
, "(float)One").WithArguments("1", "float", "E").WithLocation(42, 11),
1062
Diagnostic(ErrorCode.
ERR_BadArgType
, "(double)One").WithArguments("1", "double", "E").WithLocation(43, 11),
1065
Diagnostic(ErrorCode.
ERR_BadArgType
, "(F)One").WithArguments("1", "F", "E").WithLocation(45, 11),
1068
Diagnostic(ErrorCode.
ERR_BadArgType
, "new object()").WithArguments("1", "object", "E").WithLocation(46, 11),
1071
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "E").WithLocation(47, 11),
1074
Diagnostic(ErrorCode.
ERR_BadArgType
, "F.One").WithArguments("1", "F", "E").WithLocation(49, 11));
Semantics\SemanticErrorTests.cs (13)
3485
Diagnostic(ErrorCode.
ERR_BadArgType
, "long.MaxValue").WithArguments("1", "long", "short").WithLocation(18, 21),
3487
Diagnostic(ErrorCode.
ERR_BadArgType
, "long.MaxValue").WithArguments("1", "long", "short").WithLocation(19, 22)
13988
new ErrorDescription { Code = (int)ErrorCode.
ERR_BadArgType
, Line = 12, Column = 26 }});
14013
Diagnostic(ErrorCode.
ERR_BadArgType
, "\"string\"").WithArguments("1", "string", "char"));
14037
Diagnostic(ErrorCode.
ERR_BadArgType
, "2").WithArguments("2", "int", "char").WithLocation(10, 22));
14064
Diagnostic(ErrorCode.
ERR_BadArgType
, "E1.A").WithArguments("1", "E1", "int").WithLocation(9, 11),
14067
Diagnostic(ErrorCode.
ERR_BadArgType
, "(E2)E1.B").WithArguments("1", "E2", "int").WithLocation(10, 11),
14070
Diagnostic(ErrorCode.
ERR_BadArgType
, "E2.X").WithArguments("1", "E2", "E1").WithLocation(12, 11),
14073
Diagnostic(ErrorCode.
ERR_BadArgType
, "(int)E2.Z").WithArguments("1", "int", "E1").WithLocation(14, 11));
14096
Diagnostic(ErrorCode.
ERR_BadArgType
, "arg").WithArguments("1", "out long", "out int").WithLocation(9, 15));
14126
new ErrorDescription { Code = (int)ErrorCode.
ERR_BadArgType
, Line = 16, Column = 13 }
14944
new ErrorDescription[] { new ErrorDescription { Code = (int)ErrorCode.
ERR_BadArgType
, Line = 21, Column = 15 } });
18852
Diagnostic(ErrorCode.
ERR_BadArgType
, "GetEnumerator").WithArguments("2", "method group", "System.RuntimeArgumentHandle").WithLocation(19, 18),
Semantics\StackAllocInitializerTests.cs (6)
1807
Diagnostic(ErrorCode.
ERR_BadArgType
, "stackalloc int [3] { 1, 2, 3 }").WithArguments("1", "System.Span<int>", "System.Span<short>").WithLocation(7, 16),
1810
Diagnostic(ErrorCode.
ERR_BadArgType
, "stackalloc int [ ] { 1, 2, 3 }").WithArguments("1", "System.Span<int>", "System.Span<short>").WithLocation(8, 16),
1813
Diagnostic(ErrorCode.
ERR_BadArgType
, "stackalloc [ ] { 1, 2, 3 }").WithArguments("1", "System.Span<int>", "System.Span<short>").WithLocation(9, 16)
1908
Diagnostic(ErrorCode.
ERR_BadArgType
, "stackalloc int [3] { 1, 2, 3 }").WithArguments("1", "System.Span<int>", "object").WithLocation(8, 11),
1911
Diagnostic(ErrorCode.
ERR_BadArgType
, "stackalloc int [ ] { 1, 2, 3 }").WithArguments("1", "System.Span<int>", "object").WithLocation(9, 11),
1914
Diagnostic(ErrorCode.
ERR_BadArgType
, "stackalloc [ ] { 1, 2, 3 }").WithArguments("1", "System.Span<int>", "object").WithLocation(10, 11)
Semantics\StackAllocSpanExpressionsTests.cs (2)
596
Diagnostic(ErrorCode.
ERR_BadArgType
, "stackalloc int [10]").WithArguments("1", "System.Span<int>", "System.Span<short>").WithLocation(7, 16)
656
Diagnostic(ErrorCode.
ERR_BadArgType
, "stackalloc int[10]").WithArguments("1", "System.Span<int>", "object").WithLocation(8, 11)
Semantics\UserDefinedConversionTests.cs (7)
263
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(H?)").WithArguments("1", "H?", "G"),
267
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(J)").WithArguments("1", "J", "G"),
271
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(J?)").WithArguments("1", "J?", "G"),
275
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(K)").WithArguments("1", "K", "G"),
279
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(K?)").WithArguments("1", "K?", "G"),
283
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(M?)").WithArguments("1", "M?", "G"),
287
Diagnostic(ErrorCode.
ERR_BadArgType
, "default(R?)").WithArguments("1", "R?", "G"));
Semantics\UseSiteErrorTests.cs (3)
2073
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "int"),
2076
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "int"),
2082
Diagnostic(ErrorCode.
ERR_BadArgType
, "null").WithArguments("1", "<null>", "int"));
Semantics\Utf8StringsLiteralsTests.cs (3)
1480
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""s""u8").WithArguments("1", "System.ReadOnlySpan<byte>", "byte[]").WithLocation(8, 35)
2692
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""3""U8").WithArguments("1", "System.ReadOnlySpan<byte>", "byte[]").WithLocation(13, 11),
2737
Diagnostic(ErrorCode.
ERR_BadArgType
, @"""3""U8").WithArguments("1", "System.ReadOnlySpan<byte>", "System.Span<byte>").WithLocation(13, 11),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (38)
Compilation\GetSemanticInfoTests.cs (1)
5470
Diagnostic(ErrorCode.
ERR_BadArgType
, "t.Result").WithArguments("1", "Program.A", "int").WithLocation(13, 51),
Symbols\ConversionTests.cs (2)
622
Diagnostic(ErrorCode.
ERR_BadArgType
, "C.Test").WithArguments("1", "method group", "C").WithLocation(5, 12));
657
Diagnostic(ErrorCode.
ERR_BadArgType
, "C.Test").WithArguments("1", "method group", "C?").WithLocation(5, 12));
Symbols\ExtensionMethodTests.cs (15)
206
Diagnostic(ErrorCode.
ERR_BadArgType
, "c.F").WithArguments("1", "object", "System.Action").WithLocation(12, 11),
208
Diagnostic(ErrorCode.
ERR_BadArgType
, "c.P").WithArguments("1", "object", "System.Action").WithLocation(13, 11));
266
Diagnostic(ErrorCode.
ERR_BadArgType
, "c.F").WithArguments("1", "object", "System.Action").WithLocation(10, 11),
268
Diagnostic(ErrorCode.
ERR_BadArgType
, "c.P").WithArguments("1", "object", "System.Action").WithLocation(11, 11));
684
Diagnostic(ErrorCode.
ERR_BadArgType
, "2.0").WithArguments("2", "double", "int").WithLocation(12, 28),
702
Diagnostic(ErrorCode.
ERR_BadArgType
, "2.0").WithArguments("2", "double", "int").WithLocation(43, 28),
708
Diagnostic(ErrorCode.
ERR_BadArgType
, "2").WithArguments("3", "int", "string").WithLocation(45, 47),
756
Diagnostic(ErrorCode.
ERR_BadArgType
, "2.0").WithArguments("3", "double", "N1.A").WithLocation(23, 26));
845
Diagnostic(ErrorCode.
ERR_BadArgType
, "1.0").WithArguments("1", "double", "int").WithLocation(10, 16));
1034
Diagnostic(ErrorCode.
ERR_BadArgType
, "c.F1").WithArguments("1", "method group", "System.Func<object, object>").WithLocation(10, 16),
1037
Diagnostic(ErrorCode.
ERR_BadArgType
, "c.F2").WithArguments("1", "method group", "System.Action<object>").WithLocation(13, 16),
1148
Diagnostic(ErrorCode.
ERR_BadArgType
, "o.E").WithArguments("1", "method group", "object").WithLocation(8, 15),
1254
Diagnostic(ErrorCode.
ERR_BadArgType
, "o.F").WithArguments("1", "method group", "System.Action").WithLocation(11, 9),
2919
Diagnostic(ErrorCode.
ERR_BadArgType
, "1d").WithArguments("1", "double", "float").WithLocation(6, 16));
2977
Diagnostic(ErrorCode.
ERR_BadArgType
, "1d").WithArguments("1", "double", "float"));
Symbols\FunctionPointerTypeSymbolTests.cs (1)
1218
Diagnostic(ErrorCode.
ERR_BadArgType
, "1").WithArguments("1", "int", "string").WithLocation(13, 12),
Symbols\GenericConstraintTests.cs (5)
2268
Diagnostic(ErrorCode.
ERR_BadArgType
, "u").WithArguments("1", "U", "int").WithLocation(12, 11),
2272
Diagnostic(ErrorCode.
ERR_BadArgType
, "u").WithArguments("1", "U", "S").WithLocation(20, 11));
2371
Diagnostic(ErrorCode.
ERR_BadArgType
, "u").WithArguments("1", "U", "object[]").WithLocation(13, 17),
2373
Diagnostic(ErrorCode.
ERR_BadArgType
, "u").WithArguments("1", "U", "System.Collections.Generic.IList<object>").WithLocation(15, 17));
6047
Diagnostic(ErrorCode.
ERR_BadArgType
, "o").WithArguments("1", "U", "System.Collections.Generic.IEnumerable<object>"),
Symbols\IndexerTests.cs (9)
244
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("2", "C", "int").WithLocation(10, 18),
856
Diagnostic(ErrorCode.
ERR_BadArgType
, "true").WithArguments("1", "bool", "int").WithLocation(8, 11),
859
Diagnostic(ErrorCode.
ERR_BadArgType
, "long.MaxValue").WithArguments("2", "long", "int").WithLocation(8, 33),
2011
Diagnostic(ErrorCode.
ERR_BadArgType
, "E.A").WithArguments("1", "E", "string"),
2014
Diagnostic(ErrorCode.
ERR_BadArgType
, "E.B").WithArguments("1", "E", "string"),
2017
Diagnostic(ErrorCode.
ERR_BadArgType
, "E.C").WithArguments("1", "E", "string"),
2020
Diagnostic(ErrorCode.
ERR_BadArgType
, "E.D").WithArguments("1", "E", "string"),
2023
Diagnostic(ErrorCode.
ERR_BadArgType
, "E.E").WithArguments("1", "E", "string"),
2026
Diagnostic(ErrorCode.
ERR_BadArgType
, "E.F").WithArguments("1", "E", "string"));
Symbols\Source\PropertyTests.cs (2)
877
Diagnostic(ErrorCode.
ERR_BadArgType
, "A.P").WithArguments("1", "void", "object"),
878
Diagnostic(ErrorCode.
ERR_BadArgType
, "x.Q").WithArguments("1", "void", "object"));
Symbols\SymbolDistinguisherTests.cs (3)
553
Diagnostic(ErrorCode.
ERR_BadArgType
, "new C()").WithArguments("1", "C [file.cs(2)]", "C [Metadata, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]").WithLocation(6, 15));
586
Diagnostic(ErrorCode.
ERR_BadArgType
, "c").WithArguments("1", "ref C [Source, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]", "ref C [Metadata, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]").WithLocation(7, 19));
789
Diagnostic(ErrorCode.
ERR_BadArgType
, "e").WithArguments("1", "System.Collections.Generic.IEnumerable<E>", "System.Collections.Generic.IEnumerable<E>").WithLocation(5, 13));