666 references to ERR_NoImplicitConv
Microsoft.CodeAnalysis.CSharp (10)
Binder\Binder_Conversions.cs (1)
1815
Error(diagnostics, ErrorCode.
ERR_NoImplicitConv
, spreadElement.Expression.Syntax, spreadElement.Expression.Display, elementType);
Binder\Binder_Invocation.cs (2)
1070
Error(diagnostics, ErrorCode.
ERR_NoImplicitConv
, call.ReceiverOpt.Syntax, distinguisher.First, distinguisher.Second);
1076
Error(diagnostics, ErrorCode.
ERR_NoImplicitConv
, call.ReceiverOpt.Syntax, distinguisher.First, distinguisher.Second);
Binder\Binder_Statements.cs (5)
1987
ErrorCode.
ERR_NoImplicitConv
,
2296
Error(diagnostics, ErrorCode.
ERR_NoImplicitConv
, syntax, distinguisher.First, distinguisher.Second);
2305
Error(diagnostics, ErrorCode.
ERR_NoImplicitConv
, syntax, sourceType, targetType);
2310
Error(diagnostics, ErrorCode.
ERR_NoImplicitConv
, syntax, distinguisher.First, distinguisher.Second);
2332
Error(diagnostics, ErrorCode.
ERR_NoImplicitConv
, syntax, operand.Display, targetType);
Errors\ErrorFacts.cs (1)
659
or ErrorCode.
ERR_NoImplicitConv
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
828
ErrorCode.
ERR_NoImplicitConv
,
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (65)
BreakingChanges.cs (2)
504
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "0").WithArguments("int", "S")
583
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "nt").WithArguments("T?", "U"));
CodeGen\CodeGenAsyncIteratorTests.cs (1)
6488
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "int").WithLocation(6, 22),
CodeGen\CodeGenAwaitUsingTests.cs (1)
648
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "System.Threading.Tasks.Task<int>").WithLocation(11, 20)
CodeGen\CodeGenDeconstructTests.cs (5)
2347
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "2").WithArguments("int", "string").WithLocation(8, 25),
5949
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "int").WithLocation(6, 30),
5952
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "42").WithArguments("int", "string").WithLocation(6, 39)
6478
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "_").WithArguments("string", "int").WithLocation(11, 30),
7346
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "args is var x2").WithArguments("int", "bool").WithLocation(6, 34),
CodeGen\CodeGenMscorlib.cs (2)
378
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "refresult").WithArguments("System.TypedReference", "object").WithLocation(10, 15),
437
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "refresult").WithArguments("System.TypedReference", "object").WithLocation(10, 15),
CodeGen\CodeGenShortCircuitOperatorTests.cs (3)
5362
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c?.M()").WithArguments("void", "object").WithLocation(16, 32),
5368
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c?.M()").WithArguments("void", "object").WithLocation(19, 37),
5371
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(new C())?.M()").WithArguments("void", "object").WithLocation(21, 32)
CodeGen\CodeGenStructsAndEnum.cs (3)
1605
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "base").WithArguments("S", "System.ValueType").WithLocation(4, 48),
1608
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "base").WithArguments("S", "System.ValueType").WithLocation(6, 42),
1611
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "base").WithArguments("S", "System.ValueType").WithLocation(8, 42));
CodeGen\CodeGenThrowTests.cs (1)
402
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "t").WithArguments("T", "System.Exception").WithLocation(6, 15)
CodeGen\CodeGenTupleEqualityTests.cs (7)
4727
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(new A(1), new A(2)) == (new X(1), new Y(2))").WithArguments("NotBool", "bool").WithLocation(7, 18),
4730
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(new A(1), new A(2)) == (new X(1), new Y(2))").WithArguments("NotBool", "bool").WithLocation(7, 18)
4736
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(new A(1), 2) != (new X(1), 2)").WithArguments("NotBool", "bool").WithLocation(7, 18)
4801
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(new A(1), new A(2)) == (new X(1), new Y(2))").WithArguments("NotBool", "bool").WithLocation(7, 18),
4804
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(new A(1), new A(2)) == (new X(1), new Y(2))").WithArguments("NotBool", "bool").WithLocation(7, 18)
4839
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(a, a) == (a, a)").WithArguments("bool?", "bool").WithLocation(6, 13),
4842
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(a, a) == (a, a)").WithArguments("bool?", "bool").WithLocation(6, 13),
CodeGen\CodeGenTupleTest.cs (36)
1538
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"(1, ""hello"", 2)").WithArguments("(int, string, int)", "(int, string)").WithLocation(6, 27));
1580
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""Alice""").WithArguments("string", "int").WithLocation(6, 55),
1583
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(1, 2, 3, 4, 5, 6, 7, 8, 9)").WithArguments("(int, int, int, int, int, int, int, int, int)", "(int, int, int, int, int, int, int, int)").WithLocation(7, 54)
1605
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"(1, ""hello"", c: 2)").WithArguments("(int, string, int c)", "(int, string a)").WithLocation(6, 29)
4953
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg.Item2.Item1").WithArguments("CA", "CB").WithLocation(25, 17)
7053
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(1, 1, 1)").WithArguments("(int, int, int)", "(int, int)").WithLocation(9, 13),
7056
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""string""").WithArguments("string", "int").WithLocation(10, 17),
7166
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(1, 1, 1)").WithArguments("(int, int, int)", "(int, int)").WithLocation(9, 13),
7169
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""string""").WithArguments("string", "int").WithLocation(10, 17),
7223
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(1, 1, 1)").WithArguments("(int, int, int)", "(string, string)").WithLocation(9, 13),
7226
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(10, 14),
7232
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(14, 14),
7235
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(15, 14),
7277
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(1, 1, 1)").WithArguments("(int, int, int)", "(int, int)").WithLocation(9, 14),
7280
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""string""").WithArguments("string", "int").WithLocation(10, 18),
7343
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "0").WithArguments("int", "(int, int)").WithLocation(8, 14),
7346
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "0.0").WithArguments("double", "int").WithLocation(9, 18),
7349
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "((0, 0),1,2,3,4,5,6,7,8,9,10,11)").WithArguments("((int, int), int, int, int, int, int, int, int, int, int, int, int)", "((int, int) x0, int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8, int x9, int x10)").WithLocation(10, 13),
7352
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "((0, 0),1,2,3,4,5,6,7,8)").WithArguments("((int, int), int, int, int, int, int, int, int, int)", "((int, int) x0, int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8, int x9, int x10)").WithLocation(11, 13),
7355
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "9.1").WithArguments("double", "int").WithLocation(12, 37),
7402
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(8, 30),
7408
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(10, 47),
7414
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1.1").WithArguments("double", "string").WithLocation(12, 48),
7420
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1.1").WithArguments("double", "string").WithLocation(14, 65),
7452
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(8, 45),
7458
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(10, 73),
7464
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1.1").WithArguments("double", "string").WithLocation(12, 73),
7470
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1.1").WithArguments("double", "string").WithLocation(14, 101),
9066
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"(""1"", ""qq"")").WithArguments("(string, string)", "C.C1").WithLocation(6, 16)
9361
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "M1()").WithArguments("(int, string)", "C.C1").WithLocation(6, 16)
10708
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(1, 2, new System.ArgIterator())").WithArguments("(int, int, System.ArgIterator)", "(int x, object y)").WithLocation(7, 31),
10717
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(1, 2, new System.ArgIterator())").WithArguments("(int, int, System.ArgIterator)", "(int x, System.ArgIterator y)").WithLocation(8, 43),
18125
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "y").WithArguments("C.C1", "(int, (object, (byte, (int?, (long, System.IComparable)?))?))?").WithLocation(10, 70)
25693
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e").WithArguments("int?", "int").WithLocation(7, 28)
25738
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e").WithArguments("int?", "int").WithLocation(7, 17)
25907
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"(e, """")").WithArguments("(int? e, string)", "(int, string, int)").WithLocation(7, 32)
CodeGen\IndexAndRangeTests.cs (2)
1619
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Index(1, false)").WithArguments("System.Index", "int").WithLocation(12, 29),
1622
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "^1").WithArguments("System.Index", "int").WithLocation(12, 50));
CodeGen\PatternTests.cs (1)
5124
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "string.Empty").WithArguments("string", "int").WithLocation(11, 41)
CodeGen\SwitchTests.cs (1)
2656
var expected = Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "default(System.DateTime)").WithArguments("System.DateTime", "int?");
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Emit\NumericIntPtrTests.cs (2)
3550
expectedExplicitIL is null ? ErrorCode.
ERR_NoImplicitConv
: ErrorCode.ERR_NoImplicitConvCast :
10286
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments(AsNative(sourceType), "FinalType"),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (232)
Attributes\AttributeTests_CallerInfoAttributes.cs (3)
858
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "Log(default(int))").WithArguments("int", "string").WithLocation(9, 9),
893
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "Log(default(int))").WithArguments("int", "string").WithLocation(9, 9),
5310
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "M2()").WithArguments("int", "string").WithLocation(13, 9));
Attributes\AttributeTests_WellKnownAttributes.cs (2)
1868
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "Goo()").WithArguments("int", "System.Enum").WithLocation(13, 9));
3030
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""str""").WithArguments("string", "System.Runtime.InteropServices.CharSet"),
Diagnostics\OperationAnalyzerTests.cs (2)
879
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "Bar").WithLocation(24, 42))
1671
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "string.Empty").WithArguments("string", "int").WithLocation(10, 17),
FirstClassSpanTests.cs (45)
866
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "source()").WithArguments("System.Span<string>", "System.ReadOnlySpan<object>").WithLocation(2, 26));
948
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "source()").WithArguments("System.ReadOnlySpan<string>", "System.ReadOnlySpan<object>").WithLocation(2, 26));
1269
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arr()").WithArguments("int[]", "System.Span<int>").WithLocation(2, 15));
1300
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "source()").WithArguments("System.Span<int>", "System.ReadOnlySpan<int>").WithLocation(2, 23));
1331
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "source()").WithArguments("System.Span<string>", "System.ReadOnlySpan<object>").WithLocation(2, 26));
1368
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "source()").WithArguments("System.Span<string>", "System.ReadOnlySpan<object>").WithLocation(2, 26));
1402
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "source()").WithArguments("System.Span<string>", "System.ReadOnlySpan<object>").WithLocation(2, 26));
1432
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "source()").WithArguments("System.ReadOnlySpan<string>", "System.ReadOnlySpan<object>").WithLocation(2, 26));
1462
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "source()").WithArguments("string", "System.ReadOnlySpan<char>").WithLocation(2, 24));
1494
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arr()").WithArguments("int[]", $"System.{type}<int>").WithLocation(3, 5));
2905
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("int[]", "System.Span<string>").WithLocation(3, 41));
2936
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("int[]", "System.ReadOnlySpan<string>").WithLocation(3, 49));
2998
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.Span<int>", "System.ReadOnlySpan<string>").WithLocation(4, 46));
3044
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.Span<S<string>>", "System.ReadOnlySpan<S<object>>").WithLocation(4, 55));
3079
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<int>", "System.ReadOnlySpan<string>").WithLocation(4, 54));
3125
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<S<string>>", "System.ReadOnlySpan<S<object>>").WithLocation(4, 63));
3238
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<string>", $"System.Span<{type}>").WithLocation(4, 49));
3370
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("string", "System.ReadOnlySpan<short>").WithLocation(4, 42));
3386
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("string", "System.Span<char>").WithLocation(4, 33));
3614
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.Span<string?>", "System.ReadOnlySpan<object>").WithLocation(9, 51),
3677
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<string?>", "System.ReadOnlySpan<object>").WithLocation(9, 59),
3878
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("S<string?>[]", "System.ReadOnlySpan<S<object>>").WithLocation(9, 53),
3918
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.Span<I<string?>>", "System.ReadOnlySpan<I<object>>").WithLocation(9, 57),
3974
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<S<string?>>", "System.ReadOnlySpan<S<object>>").WithLocation(9, 65),
4018
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<I<string?>>", "System.ReadOnlySpan<I<object>>").WithLocation(5, 64));
4335
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.Span<int>", "int[]").WithLocation(3, 40),
4338
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<int>", "int[]").WithLocation(4, 48),
4341
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<string>", "object[]").WithLocation(5, 54),
4344
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<object>", "string[]").WithLocation(6, 54));
4360
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<int>", "System.Span<int>").WithLocation(4, 45));
4376
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<object>", "System.ReadOnlySpan<string>").WithLocation(4, 59));
4392
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arg").WithArguments("System.ReadOnlySpan<char>", "string").WithLocation(4, 43));
4859
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a").WithArguments("string[*,*]", "System.Span<string>").WithLocation(5, 37),
4862
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a").WithArguments("string[][]", "System.Span<string>").WithLocation(6, 38),
4865
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a").WithArguments("string[*,*]", "System.Span<string[]>").WithLocation(7, 39),
4868
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a").WithArguments("string[*,*][]", "System.Span<string[][]>").WithLocation(9, 43),
4871
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a").WithArguments("string[][][]", "System.Span<string[*,*]>").WithLocation(11, 43));
5690
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("I<string>[]", $"System.{type}<I<object>>").WithLocation(6, 12));
5808
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("int[]", "System.ReadOnlySpan<long>").WithLocation(5, 38));
5854
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T?[]", "System.ReadOnlySpan<T>").WithLocation(5, 34));
5871
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T[]", "System.ReadOnlySpan<T?>").WithLocation(5, 34));
5892
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T[]", "System.ReadOnlySpan<U>").WithLocation(4, 34),
5898
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T[]", "System.Span<U>").WithLocation(6, 26),
5977
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("System.Span<T>", "System.ReadOnlySpan<U>").WithLocation(6, 38),
6001
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("System.ReadOnlySpan<T>", "System.ReadOnlySpan<U>").WithLocation(6, 46),
RefReadonlyParameterTests.cs (1)
5202
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "i").WithArguments("int", "C").WithLocation(6, 5),
RefStructInterfacesTests.cs (17)
5894
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("S1", "I1").WithLocation(10, 30),
20579
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T", "object").WithLocation(6, 16),
20612
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T", "I1").WithLocation(10, 16),
20646
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T", "U").WithLocation(11, 16),
20690
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T", "object").WithLocation(11, 16),
20693
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("S", "object").WithLocation(16, 16),
20742
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T", "I1").WithLocation(13, 16),
20745
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("S", "I1").WithLocation(18, 16),
20784
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("I1", "S").WithLocation(14, 16),
20821
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T", "S").WithLocation(15, 16),
20937
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T", "U").WithLocation(100, 16),
20943
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T", "U").WithLocation(300, 16),
20949
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "y").WithArguments("U", "T").WithLocation(500, 16),
20955
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "y").WithArguments("U", "T").WithLocation(700, 16),
20961
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T", "U").WithLocation(900, 16),
21027
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T", "object").WithLocation(7, 16),
21030
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "y").WithArguments("S", "System.ValueType").WithLocation(12, 16)
Semantics\CollectionExpressionTests.cs (57)
5793
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "char").WithLocation(10, 14),
5857
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "char").WithLocation(9, 22),
6143
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "p").WithArguments("void*", "object").WithLocation(14, 22));
7360
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "u").WithArguments("U", "T").WithLocation(9, 44),
7363
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "y").WithArguments("U", "T").WithLocation(13, 50));
7389
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "t").WithArguments("T", "U").WithLocation(9, 41),
7392
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("T", "U").WithLocation(13, 47));
8575
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(5, 27),
8578
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3").WithArguments("int", "string").WithLocation(6, 32));
8626
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(5, 27),
8629
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3").WithArguments("int", "string").WithLocation(6, 32));
10105
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("object", "int").WithLocation(8, 41));
10959
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d1").WithArguments("object", "int").WithLocation(10, 22),
10962
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d2").WithArguments("object", "int").WithLocation(10, 28),
10965
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e1").WithArguments("object", "int").WithLocation(10, 34),
10968
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e2").WithArguments("object", "int").WithLocation(10, 40));
11006
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d1").WithArguments("object", "int").WithLocation(12, 16),
11009
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d2").WithArguments("object", "int").WithLocation(12, 22),
11012
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e1").WithArguments("object", "int").WithLocation(12, 28),
11015
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e2").WithArguments("object", "int").WithLocation(12, 34));
11147
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d1").WithArguments("object", "int").WithLocation(10, 34),
11150
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d2").WithArguments("object", "int").WithLocation(10, 40),
11153
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e1").WithArguments("object", "int").WithLocation(10, 46),
11156
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e2").WithArguments("object", "int").WithLocation(10, 52),
11159
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(dynamic)x").WithArguments("object", "int").WithLocation(14, 16),
11162
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(IEnumerable)y").WithArguments("object", "int").WithLocation(14, 30));
11219
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d1").WithArguments("object", "int").WithLocation(10, 34),
11222
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d2").WithArguments("object", "int").WithLocation(10, 40),
11225
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e1").WithArguments("object", "int").WithLocation(10, 46),
11228
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e2").WithArguments("object", "int").WithLocation(10, 52),
11231
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(dynamic)x").WithArguments("object", "int").WithLocation(14, 16),
11234
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(IEnumerable)y").WithArguments("object", "int").WithLocation(14, 30));
20308
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "string.Empty").WithArguments("string", "int").WithLocation(5, 32),
20341
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "string.Empty").WithArguments("string", "int").WithLocation(5, 32),
20368
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "string.Empty").WithArguments("string", "int").WithLocation(6, 14),
21699
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e").WithArguments("object", "int").WithLocation(4, 42));
25017
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d").WithArguments("System.DateTimeOffset", "System.DateTime").WithLocation(3, 29),
25020
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d").WithArguments("System.DateTimeOffset", "System.DateTime").WithLocation(4, 34));
27144
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("object", "int").WithLocation(15, 39));
27185
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("object", "int").WithLocation(15, 39));
27834
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new B()").WithArguments("B", "A").WithLocation(3, 5),
27837
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new B()").WithArguments("B", "A").WithLocation(8, 5));
28845
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(4, 8)
28884
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "values").WithArguments("int", "string").WithLocation(5, 10)
29058
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(6, 91),
29061
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "2").WithArguments("int", "string").WithLocation(7, 98),
29064
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3").WithArguments("int", "string").WithLocation(8, 99),
29070
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "4").WithArguments("int", "string").WithLocation(9, 98)
29119
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(5, 78),
29122
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "2").WithArguments("int", "string").WithLocation(6, 85),
29125
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3").WithArguments("int", "string").WithLocation(7, 86),
29131
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "4").WithArguments("int", "string").WithLocation(8, 85)
29787
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hi""").WithArguments("string", "int").WithLocation(4, 17),
29821
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hi""").WithArguments("string", "int").WithLocation(8, 17),
30008
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Source()").WithArguments("Source", "Destination").WithLocation(4, 17)
30071
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Source()").WithArguments("Source", "Destination").WithLocation(4, 17)
38997
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""a""").WithArguments("string", "object[]").WithLocation(5, 29));
Semantics\ExtensionOperatorsTests.cs (7)
2428
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("I2", "bool").WithLocation(35, 12)
2484
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("I2", "bool").WithLocation(37, 16)
2523
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("S1?", "bool").WithLocation(22, 13)
2567
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("S1", "bool").WithLocation(22, 13)
2623
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("S1?", "bool").WithLocation(22, 13),
2952
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("S1?", "bool").WithLocation(23, 56)
22177
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1 += s2").WithArguments("S2", "S1").WithLocation(23, 13),
Semantics\ExtensionTests.cs (7)
4659
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "int").WithLocation(7, 20)
4665
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "int").WithLocation(7, 20),
4703
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "int").WithLocation(7, 20)
4712
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "int").WithLocation(7, 20)
15748
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "D.f").WithArguments("string", "System.Action").WithLocation(2, 19));
26866
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "M(ts)").WithArguments("string", "int").WithLocation(6, 33),
26904
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "M(P)").WithArguments("string", "int").WithLocation(6, 33),
Semantics\OutVarTests.cs (28)
22763
(int)ErrorCode.
ERR_NoImplicitConv
26585
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "H.TakeOutParam(1, out int x1)").WithArguments("bool", "int").WithLocation(2, 8),
26591
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "H.TakeOutParam(2, out int x2)").WithArguments("bool", "int").WithLocation(6, 8),
26597
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "H.TakeOutParam(3, out int x3)").WithArguments("bool", "int").WithLocation(8, 8),
26606
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"H.Dummy(H.TakeOutParam(41, out int x4),
26729
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "H.TakeOutParam(1, out var x1)").WithArguments("bool", "int").WithLocation(2, 8),
26735
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "H.TakeOutParam(2, out var x2)").WithArguments("bool", "int").WithLocation(6, 8),
26741
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "H.TakeOutParam(3, out var x3)").WithArguments("bool", "int").WithLocation(8, 8),
26750
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"H.Dummy(H.TakeOutParam(41, out var x4),
34354
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "TakeOutParam(true, out var x1)").WithArguments("bool", "int").WithLocation(12, 20),
34357
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x1").WithArguments("bool", "int").WithLocation(12, 51),
34369
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "TakeOutParam(true, out var x2)").WithArguments("bool", "int").WithLocation(20, 20),
34372
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x2").WithArguments("bool", "int").WithLocation(20, 51),
34384
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "TakeOutParam(true, out var x3)").WithArguments("bool", "int").WithLocation(29, 20),
34390
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x3").WithArguments("bool", "int").WithLocation(29, 51),
34463
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "TakeOutParam(true, out var x1)").WithArguments("bool", "int").WithLocation(12, 19),
34466
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x1").WithArguments("bool", "int").WithLocation(12, 51),
34478
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "TakeOutParam(true, out var x2)").WithArguments("bool", "int").WithLocation(21, 19),
34564
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "TakeOutParam(true, out var x1)").WithArguments("bool", "int").WithLocation(12, 18),
34567
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x1").WithArguments("bool", "int").WithLocation(12, 49),
34582
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "TakeOutParam(true, out var x2)").WithArguments("bool", "int").WithLocation(21, 18),
34585
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x2").WithArguments("bool", "int").WithLocation(21, 49),
34664
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "TakeOutParam(true, out var x1)").WithArguments("bool", "int").WithLocation(12, 20),
34667
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x1").WithArguments("bool", "int").WithLocation(12, 52),
34682
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "TakeOutParam(true, out var x2)").WithArguments("bool", "int").WithLocation(20, 20),
34685
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x2").WithArguments("bool", "int").WithLocation(20, 52),
34700
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "TakeOutParam(true, out var x3)").WithArguments("bool", "int").WithLocation(29, 20),
34706
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x3").WithArguments("bool", "int").WithLocation(29, 52),
Semantics\ParamsCollectionTests.cs (6)
1334
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""2""").WithArguments("string", "char").WithLocation(20, 15),
1337
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3").WithArguments("int", "char").WithLocation(20, 20),
1349
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3").WithArguments("int", "char").WithLocation(24, 15),
1352
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3").WithArguments("int", "string").WithLocation(27, 28)
2475
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""2""").WithArguments("string", "char").WithLocation(17, 15),
2478
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3").WithArguments("int", "char").WithLocation(17, 20)
Semantics\PatternMatchingTests_Global.cs (4)
1050
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1 is int x1").WithArguments("bool", "int").WithLocation(2, 9),
1059
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3 is int x3").WithArguments("bool", "int").WithLocation(8, 9),
1182
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1 is var x1").WithArguments("bool", "int").WithLocation(2, 9),
1191
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3 is var x3").WithArguments("bool", "int").WithLocation(8, 9),
Semantics\PatternMatchingTests_ListPatterns.cs (9)
2887
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a").WithArguments("int[]", "int").WithLocation(7, 25));
8845
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("int", "int[]").WithLocation(4, 22),
8854
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "y").WithArguments("int", "int[]").WithLocation(8, 23),
8860
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "z").WithArguments("bool", "bool[]").WithLocation(13, 23),
8891
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("bool", "bool[]").WithLocation(4, 23),
8897
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("bool", "bool[]").WithLocation(4, 28),
8906
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "z").WithArguments("bool", "bool[]").WithLocation(8, 23),
8909
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "z").WithArguments("bool", "bool[]").WithLocation(8, 29),
8950
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "int[]").WithLocation(9, 27)
Semantics\PatternMatchingTests_Scope.cs (5)
13514
(int)ErrorCode.
ERR_NoImplicitConv
13752
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "string.Empty is var x3").WithArguments("bool", "int").WithLocation(8, 29)
13782
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "string.Empty is var x3").WithArguments("bool", "int").WithLocation(8, 22)
13814
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x1").WithArguments("int", "string").WithLocation(7, 21),
13916
int[] exclude = new int[] { (int)ErrorCode.
ERR_NoImplicitConv
, (int)ErrorCode.WRN_UnreferencedVar };
Semantics\PatternMatchingTests2.cs (6)
853
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(1, 2)").WithArguments("(int, int)", "N.var").WithLocation(9, 21),
1320
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "0").WithArguments("int", "string").WithLocation(7, 41)
2858
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new E()").WithArguments("E", "D").WithLocation(25, 18),
2861
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new F()").WithArguments("F", "D").WithLocation(26, 18),
2864
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new E()").WithArguments("E", "D").WithLocation(63, 18),
2867
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new F()").WithArguments("F", "D").WithLocation(64, 18)
Semantics\PatternMatchingTests3.cs (13)
906
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("Source1", "Ultimate").WithLocation(10, 42),
909
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("Source1", "Ultimate").WithLocation(10, 54),
912
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("Source1", "Ultimate").WithLocation(12, 33),
915
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("Source1", "Ultimate").WithLocation(12, 45));
965
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("Source1", "Ultimate").WithLocation(11, 42),
968
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s2").WithArguments("Source2", "Ultimate").WithLocation(11, 54),
971
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("Source1", "Ultimate").WithLocation(13, 33),
974
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s2").WithArguments("Source2", "Ultimate").WithLocation(13, 45));
1925
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "goto case a is (var x1, var x2);").WithArguments("bool", "(object a, object b)").WithLocation(9, 17),
5881
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "0").WithArguments("int", "bool").WithLocation(5, 25),
5884
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "500").WithArguments("int", "bool").WithLocation(5, 33),
5890
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "0").WithArguments("int", "bool").WithLocation(6, 23),
5893
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "0").WithArguments("int", "bool").WithLocation(7, 21)
Semantics\PatternMatchingTests4.cs (1)
3245
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "goto case string.Empty;").WithArguments("string", "int").WithLocation(10, 21)
Semantics\PatternMatchingTests5.cs (11)
2179
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "C").WithLocation(7, 5),
2185
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "C").WithLocation(8, 7),
2200
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "C").WithLocation(12, 5)
2241
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "C").WithLocation(7, 5),
2247
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "C").WithLocation(8, 7),
2262
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "C").WithLocation(12, 5),
2305
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "C").WithLocation(7, 5),
2311
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "C").WithLocation(8, 7),
2326
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "C").WithLocation(12, 5)
2473
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", $"System.Numerics.INumberBase<{inputType}>").WithLocation(5, 5),
2479
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", $"System.Numerics.INumberBase<{inputType}>").WithLocation(6, 7)
Semantics\PatternSwitchTests.cs (4)
166
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""goo""").WithArguments("string", "bool").WithLocation(10, 18)
456
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3").WithArguments("int", "bool").WithLocation(10, 18)
981
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""goo""").WithArguments("string", "bool").WithLocation(11, 18)
986
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""goo""").WithArguments("string", "bool").WithLocation(11, 18)
Semantics\PrimaryConstructorTests.cs (1)
8315
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "T").WithArguments("int", "System.Action").WithLocation(6, 30),
Semantics\RecordTests.cs (3)
2052
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "int").WithLocation(8, 26)
8072
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "int").WithLocation(8, 26)
8621
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""a""").WithArguments("string", "int").WithLocation(8, 26)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (47)
IOperation\FunctionPointerOperations.cs (2)
436
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "ptr(Prop)").WithArguments("int", "string").WithLocation(7, 20),
439
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "ptr(Prop)").WithArguments("int", "string").WithLocation(8, 13)
IOperation\IOperationTests_ArrayCreationAndInitializer.cs (1)
755
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(6, 42)
IOperation\IOperationTests_IAnonymousFunctionExpression.cs (1)
331
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(Action)(() => F())").WithArguments("System.Action", "System.Action<int>").WithLocation(8, 35)
IOperation\IOperationTests_IArgument.cs (3)
1246
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "C0.M0()").WithArguments("int", "string").WithLocation(6, 19),
1255
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "C0.M0()").WithArguments("int", "string").WithLocation(6, 19)
2392
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "p.M1()").WithArguments("string", "int").WithLocation(7, 20)
IOperation\IOperationTests_IArrayElementReferenceExpression.cs (1)
462
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c").WithArguments("C", "int").WithLocation(6, 32)
IOperation\IOperationTests_ICompoundAssignmentOperation.cs (2)
195
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c += x").WithArguments("int", "C").WithLocation(8, 19)
494
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c += x").WithArguments("int", "C").WithLocation(8, 19)
IOperation\IOperationTests_IConversionExpression.cs (14)
920
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C2()").WithArguments("C2", "C1").WithLocation(8, 27)
1228
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c2arr").WithArguments("C2[]", "C1[][]").WithLocation(9, 34)
1267
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c2arr").WithArguments("C2[]", "C1[]").WithLocation(9, 32)
1313
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new S1[10]").WithArguments("S1[]", "I1[]").WithLocation(8, 32)
1568
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d1()").WithArguments("void", "System.Delegate").WithLocation(10, 33)
1940
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new T()").WithArguments("T", "C1").WithLocation(7, 27)
2090
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new T()").WithArguments("T", "U").WithLocation(12, 25)
2296
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C1()").WithArguments("C1", "System.ValueType").WithLocation(8, 34)
2370
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new S1()").WithArguments("S1", "I1").WithLocation(10, 27)
2440
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("S1?", "I1").WithLocation(11, 27)
2518
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "System.Enum").WithLocation(13, 28)
2854
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "this").WithArguments("C1", "C2").WithLocation(7, 27),
3109
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "num").WithArguments("int", "bool").WithLocation(9, 60),
3329
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "objectAction").WithArguments("System.Action<object>", "System.Action<int>").WithLocation(8, 43)
IOperation\IOperationTests_IDelegateCreationExpression.cs (4)
1284
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Action(M1)").WithArguments("System.Action", "System.Action<string>").WithLocation(7, 38)
1315
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Action(M1)").WithArguments("System.Action", "System.Func<string>").WithLocation(7, 36)
1575
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Action((Action)M1)").WithArguments("System.Action", "System.Action<string>").WithLocation(7, 38)
1609
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Action((Action)M1)").WithArguments("System.Action", "System.Func<string>").WithLocation(7, 36)
IOperation\IOperationTests_IFixedStatement.cs (2)
406
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "p").WithArguments("int*", "object").WithLocation(9, 46)
493
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "p").WithArguments("int*", "object").WithLocation(11, 50)
IOperation\IOperationTests_IIfStatement.cs (2)
2544
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a ? b : c").WithArguments("P", "bool").WithLocation(6, 13)
3043
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a ?? b").WithArguments("P", "bool").WithLocation(6, 13)
IOperation\IOperationTests_IInterpolatedStringOperation.cs (1)
1443
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a ? b : c").WithArguments("string", "int").WithLocation(8, 20)
IOperation\IOperationTests_IIsPatternExpression.cs (1)
2475
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "42").WithArguments("int", "int[]").WithLocation(6, 31)
IOperation\IOperationTests_InvalidExpression.cs (1)
194
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x.i1").WithArguments("int", "string").WithLocation(10, 30),
IOperation\IOperationTests_InvalidStatement.cs (6)
114
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "Program").WithLocation(10, 18)
162
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "string").WithLocation(11, 18)
208
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x = null").WithArguments("Program", "bool").WithLocation(9, 23)
270
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("Program", "bool").WithLocation(12, 18),
322
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("Program", "bool").WithLocation(9, 27)
406
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "goto case args is (var x1, var x2);").WithArguments("bool", "(string, string)").WithLocation(11, 27),
IOperation\IOperationTests_IObjectCreationExpression.cs (2)
379
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "B").WithLocation(21, 36),
2667
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "B").WithLocation(24, 40),
IOperation\IOperationTests_ISwitchOperation.cs (1)
1395
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "MyClass").WithLocation(8, 18)
IOperation\IOperationTests_ITupleExpression.cs (2)
1010
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C(0)").WithArguments("C", "short").WithLocation(29, 40)
1090
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C(0)").WithArguments("C", "short").WithLocation(29, 40)
IOperation\IOperationTests_IVariableDeclaration.cs (1)
1322
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "y is int z").WithArguments("bool", "int").WithLocation(7, 23),
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (1)
InteractiveSessionReferencesTests.cs (1)
446
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c2").WithArguments($"C [{c2.Path}]", $"C [{c1.Path}]"));
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (2)
InteractiveSessionTests.cs (1)
1476
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1+1").WithArguments("int", "string"));
ScriptTests.cs (1)
1037
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "5").WithArguments("int", "string").WithLocation(1, 30));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (249)
Semantics\ArglistTests.cs (9)
579
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new System.TypedReference()").WithArguments("System.TypedReference", "object").WithLocation(30, 23),
829
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "__refvalue(123, int)").WithArguments("int", "System.TypedReference"),
1374
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "rah").WithArguments("System.RuntimeArgumentHandle", "object"),
1377
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "ai").WithArguments("System.ArgIterator", "object"),
1380
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "tr").WithArguments("System.TypedReference", "object"),
1383
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "rah").WithArguments("System.RuntimeArgumentHandle", "System.ValueType"),
1386
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "ai").WithArguments("System.ArgIterator", "System.ValueType"),
1389
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "tr").WithArguments("System.TypedReference", "System.ValueType"),
1392
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "rah").WithArguments("System.RuntimeArgumentHandle", "System.ValueType")
Semantics\BindingAsyncTests.cs (1)
3824
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "T")
Semantics\BindingTests.cs (1)
2292
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "p2").WithArguments("<anonymous type: string Price>", "<anonymous type: double Price>"));
Semantics\ConditionalOperatorTests.cs (9)
139
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "GetVoid()").WithArguments("void", "bool"));
141
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "GetInt()").WithArguments("int", "bool"));
174
TestConditional(@"GetUserNonGeneric()? 1 : 2", null, Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "GetUserNonGeneric()").WithArguments("C", "bool"));
175
TestConditional(@"GetUserGeneric<T>()? 1 : 2", null, Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "GetUserGeneric<T>()").WithArguments("D<T>", "bool"));
176
TestConditional(@"GetTypeParameter<T>()? 1 : 2", null, Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "GetTypeParameter<T>()").WithArguments("T", "bool"));
177
TestConditional(@"GetVariantInterface<T, U>()? 1 : 2", null, Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "GetVariantInterface<T, U>()").WithArguments("I<T, U>", "bool"));
185
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "bool"));
195
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "bool")
198
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "bool")
Semantics\ConstantTests.cs (1)
3461
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c.Select(o => new { E = F })").WithArguments("System.Collections.Generic.IEnumerable<<anonymous type: int E>>", "int").WithLocation(9, 9)
Semantics\DeconstructionTests.cs (9)
773
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "y").WithArguments("int", "string").WithLocation(8, 23)
1201
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "2").WithArguments("int", "string").WithLocation(9, 32)
2877
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "var").WithLocation(6, 35),
2880
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "2").WithArguments("int", "var").WithLocation(6, 38)
2929
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "3").WithArguments("int", "D").WithLocation(7, 35),
2932
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "4").WithArguments("int", "D").WithLocation(7, 38)
4155
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x1").WithArguments("int", "string").WithLocation(7, 21),
4158
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x2").WithArguments("int", "string").WithLocation(7, 30),
6107
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "2").WithArguments("int", "void").WithLocation(5, 31)
Semantics\DelegateTypeTests.cs (11)
5017
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "string.Empty").WithArguments("string", "int").WithLocation(11, 17),
10474
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d1").WithArguments("System.Action", "System.Func<int>").WithLocation(8, 13),
10477
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d2").WithArguments("System.Func<int, object>", "System.Func<int>").WithLocation(10, 13),
10480
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d3").WithArguments("System.Func<string>", "System.Func<int>").WithLocation(12, 13));
16110
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "lam2").WithArguments("<anonymous delegate>", "<anonymous delegate>").WithLocation(10, 16));
16282
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "lam1").WithArguments("<anonymous delegate>", "System.Func<int, int, int, int>").WithLocation(9, 16));
17207
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "5").WithArguments("int", "string").WithLocation(9, 24),
19570
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "withParams").WithArguments("<anonymous delegate>", "System.Func<int[], int>").WithLocation(3, 12),
19573
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "noParams").WithArguments("System.Func<int[], int>", "<anonymous delegate>").WithLocation(4, 14));
19590
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "withParams").WithArguments("<anonymous delegate>", "System.Func<int[], int>").WithLocation(5, 12),
19593
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "noParams").WithArguments("System.Func<int[], int>", "<anonymous delegate>").WithLocation(6, 14));
Semantics\DynamicTests.cs (3)
60
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d").WithArguments("dynamic", "void*"),
2833
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "ptr").WithArguments("int*", "dynamic").WithLocation(17, 17),
2839
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "default(TypedReference)").WithArguments("System.TypedReference", "dynamic").WithLocation(19, 17)
Semantics\ForLoopErrorTests.cs (2)
56
VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "i").WithArguments("int", "bool"));
173
Diagnostic(ErrorCode.
ERR_NoImplicitConv
,
Semantics\FunctionPointerTests.cs (4)
556
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("S", "delegate*<void>").WithLocation(15, 15),
559
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "ptr").WithArguments("delegate*<void>", "S").WithLocation(16, 13),
3135
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "ptr").WithArguments("delegate*<void>", "dynamic").WithLocation(6, 21),
3141
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d").WithArguments("dynamic", "delegate*<void>").WithLocation(8, 15),
Semantics\ImplicitlyTypedLocalsTests.cs (1)
108
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "var"));
Semantics\IndexAndRangeTests.cs (9)
960
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"^""string""").WithArguments("string", "int").WithLocation(6, 17),
963
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "^1.5").WithArguments("double", "int").WithLocation(7, 17),
966
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "^true").WithArguments("bool", "int").WithLocation(8, 17));
1082
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "index").WithArguments("int?", "System.Index?").WithLocation(18, 17),
1088
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "index").WithArguments("int?", "System.Index?").WithLocation(18, 24));
1424
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""string""").WithArguments("string", "System.Index").WithLocation(6, 20),
1427
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1.5").WithArguments("double", "System.Index").WithLocation(7, 17),
1430
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "true").WithArguments("bool", "System.Index").WithLocation(8, 19),
1433
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "M()").WithArguments("void", "System.Index").WithLocation(9, 19));
Semantics\InterpolationTests.cs (9)
998
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "Program.Main(null)").WithArguments("void", "object").WithLocation(7, 35));
1009
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "Program.Main(null)").WithArguments("void", "object").WithLocation(7, 35));
1072
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""X = { 1 } """).WithArguments("bool", "string").WithLocation(17, 21)
1620
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""{""""}""").WithArguments("System.FormattableString", "System.IFormattable").WithLocation(23, 33)
1649
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""{""""}""").WithArguments("void", "System.IFormattable").WithLocation(16, 33)
4237
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""""").WithArguments("string", "S").WithLocation(8, 25)
6016
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"(bool)(object)false ? default(CustomHandler) : " + expression).WithArguments("string", "CustomHandler").WithLocation(4, 19)
13744
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""{1}"" + $""literal""").WithArguments("string", "System.FormattableString").WithLocation(3, 30)
13766
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""{1}"" + $""literal""").WithArguments("string", "System.IFormattable").WithLocation(3, 25)
Semantics\LambdaTests.cs (5)
689
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "int").WithLocation(7, 39),
5539
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "v").WithArguments("V", "T").WithLocation(7, 30),
5570
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "v").WithArguments("V", "T").WithLocation(8, 21),
5607
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "v").WithArguments("V", "T").WithLocation(8, 64),
5613
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "t").WithArguments("T", "V").WithLocation(9, 54),
Semantics\LocalFunctionTests.cs (1)
2704
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "CallerMemberName()").WithArguments("string", "int").WithLocation(13, 9));
Semantics\MultiDimensionalArrayTests.cs (4)
476
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "t.Test1()").WithArguments("double[*]", "double[]").WithLocation(6, 23),
482
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "t.Test1()").WithArguments("double[*]", "System.Collections.Generic.IList<double>").WithLocation(8, 55),
491
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "ilist").WithArguments("System.Collections.Generic.IList<double>", "double[*]").WithLocation(14, 19),
494
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new [] { 3.0d }").WithArguments("double[]", "double[*]").WithLocation(16, 19)
Semantics\NamedAndOptionalTests.cs (1)
2443
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "p.M1()").WithArguments("string", "int").WithLocation(7, 31));
Semantics\NativeIntegerTests.cs (2)
7852
expectedExplicitIL is null ? ErrorCode.
ERR_NoImplicitConv
: ErrorCode.ERR_NoImplicitConvCast :
15075
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments(sourceType, "FinalType"),
Semantics\NullableReferenceTypesTests.cs (26)
4047
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e").WithArguments("TException", "System.Exception").WithLocation(32, 15),
4050
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e").WithArguments("TException", "System.Exception").WithLocation(36, 15),
4053
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e").WithArguments("TException", "System.Exception").WithLocation(40, 15),
4056
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e").WithArguments("T", "System.Exception").WithLocation(44, 15)
52295
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "42").WithArguments("int", "string").WithLocation(23, 33),
52451
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "bool").WithLocation(10, 40),
52546
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "bool?").WithLocation(10, 39),
64972
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "42").WithArguments("int", "string").WithLocation(9, 17),
75592
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x1.E1 += y1").WithArguments("void", "System.Action").WithLocation(10, 28),
75598
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x2.E1 -= y2").WithArguments("void", "System.Action").WithLocation(15, 28),
87102
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a1").WithArguments("A", "B?").WithLocation(15, 17),
87108
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a2").WithArguments("A?", "B?").WithLocation(22, 17),
87114
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a3").WithArguments("A?", "B?").WithLocation(28, 17),
129835
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("U", "int?").WithLocation(9, 18),
129841
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("U", "int?").WithLocation(18, 18),
129881
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "t").WithArguments("int?", "U").WithLocation(9, 15),
129887
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "t").WithArguments("int?", "U").WithLocation(19, 15));
130068
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(U)x").WithArguments("U", "int").WithLocation(9, 17),
133021
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Pair<T, U?>()").WithArguments("Pair<T, U?>", "(T, U?)").WithLocation(9, 21),
137948
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C()").WithArguments("C", "Base<string, object?>").WithLocation(4, 31),
137951
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C()").WithArguments("C", "Base<string, object>").WithLocation(5, 30),
137954
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C()").WithArguments("C", "Base<string?, object?>").WithLocation(6, 32)
138246
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C1<C>()").WithArguments("C1<C>", "Base<C, object?>").WithLocation(4, 26),
138249
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C1<C>()").WithArguments("C1<C>", "Base<C, object>").WithLocation(5, 25),
138252
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C2<C>()").WithArguments("C2<C>", "Base<object?, C>").WithLocation(7, 26),
138255
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C2<C>()").WithArguments("C2<C>", "Base<object, C>").WithLocation(8, 25)
Semantics\ObjectAndCollectionInitializerTests.cs (2)
4126
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "I").WithLocation(8, 27),
4129
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "2").WithArguments("int", "I").WithLocation(8, 30),
Semantics\OperatorTests.cs (1)
5462
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c").WithArguments("Program.C?", "bool"),
Semantics\RawInterpolationTests.cs (3)
1009
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "Program.Main(null)").WithArguments("void", "object").WithLocation(7, 37));
1071
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""""""X = { 1 } """"""").WithArguments("bool", "string").WithLocation(17, 21));
1285
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""""""{""""}""""""").WithArguments("System.FormattableString", "System.IFormattable").WithLocation(23, 33));
Semantics\RawInterpolationTests_Handler.cs (3)
4268
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"(bool)(object)false ? default(CustomHandler) : " + expression).WithArguments("string", "CustomHandler").WithLocation(4, 19));
10345
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""""""{1}"""""" + $""""""literal""""""").WithArguments("string", "System.FormattableString").WithLocation(3, 30));
10366
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""""""{1}"""""" + $""""""literal""""""").WithArguments("string", "System.IFormattable").WithLocation(3, 25));
Semantics\RefEscapingTests.cs (2)
194
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s1").WithArguments("System.Span<int>", "object").WithLocation(9, 22),
197
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s2").WithArguments("System.Span<int>", "object").WithLocation(14, 22));
Semantics\ScriptSemanticsTests.cs (1)
872
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""x""").WithArguments("string", "int"));
Semantics\SemanticAnalyzerTests.cs (3)
714
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "M()").WithArguments("void", "int").WithLocation(31, 18),
1137
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "false").WithArguments("bool", "E").WithLocation(11, 13),
1155
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "true").WithArguments("bool", "E").WithLocation(32, 13),
Semantics\SemanticErrorTests.cs (33)
153
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arrfoo").WithArguments("boo[]", "boo"),
156
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "arrfoo").WithArguments("boo[]", "boo"),
159
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new boo[] { p.bar, abc.far }").WithArguments("boo[]", "boo"),
162
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new boo[] { p.bar, abc.far }").WithArguments("boo[]", "boo"),
193
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "md2").WithArguments("MyDelegate2", "MyDelegate1")
341
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d2").WithArguments("Delegate2", "Delegate1"),
344
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d1").WithArguments("Delegate1", "Delegate2"),
347
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "d3").WithArguments("Delegate3", "Delegate2")
419
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "goo1").WithArguments("boo<string>", "boo<int>").WithLocation(25, 16),
422
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "goo").WithArguments("boo<int>", "boo<string>").WithLocation(26, 17));
1440
new ErrorDescription[] { new ErrorDescription { Code = (int)ErrorCode.
ERR_NoImplicitConv
, Line = 11, Column = 20 } });
1450
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new[] { 1, 2, 3 }").WithArguments("int[]", "int").WithLocation(1, 14));
1475
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "F()").WithArguments("D", "C").WithLocation(5, 21));
1495
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "m").WithArguments("bool", "int").WithLocation(6, 29));
1515
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "throw null").WithArguments("<throw expression>", "void").WithLocation(6, 23));
1535
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "throw null").WithArguments("<throw expression>", "void").WithLocation(6, 29));
1576
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "true ? M2() : M2()").WithArguments("void", "object").WithLocation(6, 22));
1616
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "M2()").WithArguments("void", "object").WithLocation(6, 22));
4300
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "iii").WithLocation(20, 15)
4627
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(string)null").WithArguments("string", "System.Exception").WithLocation(10, 26),
4630
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "System.Exception").WithLocation(11, 26),
4633
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "T").WithArguments("string", "System.Exception").WithLocation(12, 26)
4656
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new C() as D").WithArguments("D", "System.Exception").WithLocation(8, 26)
4684
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "default(T)").WithArguments("T", "System.Exception").WithLocation(11, 26),
4687
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "default(TC)").WithArguments("TC", "System.Exception").WithLocation(12, 26),
4690
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "default(TS)").WithArguments("TS", "System.Exception").WithLocation(13, 26)
5563
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "bool").WithLocation(11, 25),
5566
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "0").WithArguments("int", "bool").WithLocation(12, 25),
5569
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""false""").WithArguments("string", "bool").WithLocation(13, 25),
9741
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "2").WithArguments("int", "S").WithLocation(5, 21));
14451
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "1").WithArguments("int", "bool").WithLocation(5, 17));
15666
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("string", "int").WithLocation(8, 61),
16030
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""Who knows the real sword of Gryffindor?""").WithArguments("string", "double").WithLocation(10, 31),
Semantics\SpanStackSafetyTests.cs (10)
363
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Span<int>()").WithArguments("System.Span<int>", "object").WithLocation(8, 20),
366
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new ReadOnlySpan<byte>()").WithArguments("System.ReadOnlySpan<byte>", "object").WithLocation(9, 20),
369
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new SpanLike<int>()").WithArguments("System.SpanLike<int>", "object")
377
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Span<int>()").WithArguments("System.Span<int>", "object").WithLocation(8, 20),
380
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new ReadOnlySpan<byte>()").WithArguments("System.ReadOnlySpan<byte>", "object").WithLocation(9, 20),
383
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new SpanLike<int>()").WithArguments("System.SpanLike<int>", "object")
1868
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "default(Span<int>)").WithArguments("System.Span<int>", "object").WithLocation(12, 9),
1871
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "default(Span<int>)").WithArguments("System.Span<int>", "System.ValueType").WithLocation(15, 9)
1986
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new System.Span<int>()").WithArguments("System.Span<int>", "object").WithLocation(6, 20),
1989
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new System.ReadOnlySpan<byte>()").WithArguments("System.ReadOnlySpan<byte>", "object").WithLocation(7, 20));
Semantics\TargetTypedConditionalOperatorTests.cs (12)
53
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"b ? $""x"" : $""x""").WithArguments("string", "System.FormattableString").WithLocation(6, 38));
90
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "GetB()").WithArguments("B", "string").WithLocation(6, 31),
93
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "GetC()").WithArguments("C", "string").WithLocation(6, 40)
100
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "GetInt()").WithArguments("int", "ulong").WithLocation(6, 43)
114
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"b ? $""x"" : ""x""").WithArguments("string", "System.FormattableString").WithLocation(6, 38)
122
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"b ? """" : null").WithArguments("string", "long?").WithLocation(6, 27)
127
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "long?").WithLocation(6, 35)
134
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "GetUInt()").WithArguments("uint", "System.Collections.IList").WithLocation(6, 42),
137
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "GetInt()").WithArguments("int", "System.Collections.IList").WithLocation(6, 54)
151
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "int").WithLocation(6, 31),
642
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(b ? a : 0) + a").WithArguments("A", "B").WithLocation(15, 16),
650
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "(b ? a : 0) + a").WithArguments("A", "B").WithLocation(15, 16));
Semantics\TopLevelStatementsTests.cs (1)
7859
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""error""").WithArguments("string", "int").WithLocation(3, 8)
Semantics\UnsafeTests.cs (2)
8753
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "api").WithArguments("int*[]", "void*[]"));
11086
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "int").WithLocation(9, 35),
Semantics\UserDefinedConversionTests.cs (2)
1253
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a++").WithArguments("int", "A")
1625
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "M1()").WithArguments("void", "C<object>").WithLocation(9, 16));
Semantics\UseSiteErrorTests.cs (1)
2222
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "e").WithArguments("SpecificException", "System.Exception").WithLocation(9, 23),
Semantics\Utf8StringsLiteralsTests.cs (64)
58
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "byte[]").WithLocation(9, 30),
61
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""").WithArguments("string", "System.Span<byte>").WithLocation(10, 34),
64
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""cat""").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(11, 42)
87
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""U8").WithArguments("System.ReadOnlySpan<byte>", "byte[]").WithLocation(9, 30),
90
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""U8").WithArguments("System.ReadOnlySpan<byte>", "System.Span<byte>").WithLocation(10, 34)
115
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "nullConstant").WithArguments("string", "byte[]").WithLocation(10, 30),
118
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "nullConstant").WithArguments("string", "System.Span<byte>").WithLocation(11, 34),
121
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "nullConstant").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(12, 42)
180
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "byte[]").WithLocation(7, 49),
183
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""").WithArguments("string", "byte[]").WithLocation(7, 59)
204
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "byte[]").WithLocation(6, 45),
207
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""").WithArguments("string", "byte[]").WithLocation(6, 55)
491
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "value").WithArguments("string", "byte[]").WithLocation(9, 24),
494
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "value").WithArguments("string", "System.Span<byte>").WithLocation(10, 27),
497
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "value").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(11, 43)
565
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "byte[*,*]").WithLocation(10, 26),
568
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "System.Span<byte[]>").WithLocation(11, 30),
571
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "System.ReadOnlySpan<byte[]>").WithLocation(12, 46),
574
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "int[]").WithLocation(14, 24),
577
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "System.Span<int>").WithLocation(15, 27),
580
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "System.ReadOnlySpan<int>").WithLocation(16, 43),
583
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "char[]").WithLocation(18, 25),
586
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "System.Span<char>").WithLocation(19, 28),
589
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "string[]").WithLocation(21, 27),
592
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "System.Span<string>").WithLocation(22, 30),
595
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "System.ReadOnlySpan<string>").WithLocation(23, 46)
644
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""s""").WithArguments("string", "byte[*]").WithLocation(8, 18)
677
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""").WithArguments("string", "System.Span<byte>").WithLocation(8, 27)
711
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""cat""").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(8, 43)
744
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""").WithArguments("string", "System.Span<byte>").WithLocation(8, 27)
778
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""cat""").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(8, 43)
825
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "C1").WithLocation(7, 16),
828
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""").WithArguments("string", "C2").WithLocation(8, 16),
831
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""cat""").WithArguments("string", "C3").WithLocation(9, 16)
877
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "C1").WithLocation(8, 29),
880
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""").WithArguments("string", "C2").WithLocation(8, 39),
883
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""cat""").WithArguments("string", "C3").WithLocation(8, 46)
928
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "C1").WithLocation(7, 33),
931
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""").WithArguments("string", "C2").WithLocation(7, 43),
934
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""cat""").WithArguments("string", "C3").WithLocation(7, 50)
1209
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "C1").WithLocation(7, 16),
1212
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""").WithArguments("string", "C2").WithLocation(8, 16),
1215
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""cat""").WithArguments("string", "C3").WithLocation(9, 16)
1261
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "C1").WithLocation(8, 29),
1264
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""").WithArguments("string", "C2").WithLocation(8, 39),
1267
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""cat""").WithArguments("string", "C3").WithLocation(8, 46)
1312
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""").WithArguments("string", "C1").WithLocation(7, 33),
1315
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""").WithArguments("string", "C2").WithLocation(7, 43),
1318
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""cat""").WithArguments("string", "C3").WithLocation(7, 50)
2239
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""u8").WithArguments("System.ReadOnlySpan<byte>", "C2").WithLocation(7, 16),
2242
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""cat""u8").WithArguments("System.ReadOnlySpan<byte>", "C3").WithLocation(8, 16)
2330
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""hello""u8").WithArguments("System.ReadOnlySpan<byte>", "C1").WithLocation(7, 16),
2333
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""dog""u8").WithArguments("System.ReadOnlySpan<byte>", "C2").WithLocation(8, 16),
2815
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "byte[]").WithLocation(7, 20),
2818
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "System.Span<byte>").WithLocation(8, 24),
2821
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "s").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(9, 32),
2857
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""1{s}""").WithArguments("string", "byte[]").WithLocation(7, 20),
2860
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""2{s}""").WithArguments("string", "System.Span<byte>").WithLocation(8, 24),
2863
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"$""3{s}""").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(9, 32),
2895
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""1""").WithArguments("string", "byte[]").WithLocation(7, 18),
2898
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""2""u8").WithArguments("System.ReadOnlySpan<byte>", "byte[]").WithLocation(8, 18)
2921
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""1""").WithArguments("string", "System.Span<byte>").WithLocation(7, 18),
2924
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""2""u8").WithArguments("System.ReadOnlySpan<byte>", "System.Span<byte>").WithLocation(8, 18)
2947
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""1""").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(7, 18),
Semantics\VarianceTests.cs (1)
233
Assert.True(code == ErrorCode.ERR_NoImplicitConvCast || code == ErrorCode.
ERR_NoImplicitConv
, "Unexpected error code " + code);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (54)
BadSymbolReference.cs (2)
1407
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "y").WithArguments("ErrorTest.C4", "ErrorTest.C1"),
1413
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "y3").WithArguments("T", "ErrorTest.C1"),
Compilation\CompilationAPITests.cs (3)
2450
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""x""").WithArguments("string", "int"));
3228
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "await System.Threading.Tasks.Task.FromResult(42)").WithArguments("int", "System.Threading.Tasks.Task<int>").WithLocation(1, 8));
3366
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""Who returns a string?""").WithArguments("string", "int").WithLocation(1, 8),
Compilation\SemanticModelAPITests.cs (2)
4563
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "var").WithLocation(1, 17),
4566
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "0").WithArguments("int", "var").WithLocation(1, 21));
Symbols\CheckedUserDefinedOperatorsTests.cs (2)
5652
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("C0", "long").WithLocation(15, 28),
5661
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("C0", "int").WithLocation(30, 28),
Symbols\ConversionTests.cs (1)
2346
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "0").WithArguments("int", "R").WithLocation(60, 17));
Symbols\DefaultInterfaceImplementationTests.cs (2)
47179
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("I1", "int").WithLocation(15, 17),
47188
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("I1", "byte").WithLocation(18, 13)
Symbols\GenericConstraintConversionTests.cs (16)
63
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "u").WithArguments("U", "A").WithLocation(28, 13),
65
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "u").WithArguments("U", "B").WithLocation(30, 13));
222
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "v").WithArguments("V", "U").WithLocation(15, 13),
226
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "u").WithArguments("U", "V").WithLocation(18, 13),
228
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "w").WithArguments("W", "V").WithLocation(19, 13),
230
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "v").WithArguments("V", "W").WithLocation(22, 13),
240
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("X", "T").WithLocation(37, 13),
242
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("X", "V").WithLocation(39, 13),
244
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "t").WithArguments("T", "X").WithLocation(41, 13),
248
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "v").WithArguments("V", "X").WithLocation(43, 13),
252
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x").WithArguments("X", "T").WithLocation(48, 13),
254
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "t").WithArguments("T", "X").WithLocation(52, 13),
820
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "t").WithArguments("int", "U").WithLocation(9, 13),
824
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "u").WithArguments("U", "int").WithLocation(11, 13),
972
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "t").WithArguments("T", "C0").WithLocation(17, 48),
974
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c").WithArguments("C4<T>", "T").WithLocation(21, 38));
Symbols\GenericConstraintTests.cs (2)
2266
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "u").WithArguments("U", "int").WithLocation(11, 17),
2270
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "u").WithArguments("U", "S").WithLocation(19, 15),
Symbols\IndexedPropertyTests.cs (1)
1332
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c.D[0]").WithArguments("int[]", "int").WithLocation(17, 13),
Symbols\PartialPropertiesTests.cs (1)
2294
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""""").WithArguments("string", "int").WithLocation(11, 36),
Symbols\Source\EnumTests.cs (1)
86
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""3""").WithArguments("string", "byte").WithLocation(3, 10),
Symbols\Source\EventTests.cs (1)
1313
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "F += new System.Action<int>(x => {})").WithArguments("System.Action<int>", "System.Action"),
Symbols\Source\ExpressionBodiedMethodTests.cs (1)
251
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"System.Console.WriteLine(""goo"")").WithArguments("void", "int").WithLocation(4, 23));
Symbols\Source\ExpressionBodiedPropertyTests.cs (1)
356
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"System.Console.WriteLine(""goo"")").WithArguments("void", "int").WithLocation(4, 21));
Symbols\Source\PropertyTests.cs (2)
1173
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "A.Goo").WithArguments("E", "B").WithLocation(5, 11)
1565
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "A.Goo").WithArguments("void", "object"));
Symbols\StaticAbstractMembersInInterfacesTests.cs (6)
30528
var error = (op == "explicit" ? ErrorCode.ERR_NoExplicitConv : ErrorCode.
ERR_NoImplicitConv
);
30602
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "x " + op + " x").WithArguments("I1", "bool").WithLocation(9, 13),
30605
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "y " + op + " y").WithArguments("I1", "bool").WithLocation(14, 13),
30608
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "a " + op + " a").WithArguments("I1", "bool").WithLocation(22, 13),
31529
var error = (op == "explicit" ? ErrorCode.ERR_NoExplicitConv : ErrorCode.
ERR_NoImplicitConv
);
31580
var error = (op == "explicit" ? ErrorCode.ERR_NoExplicitConv : ErrorCode.
ERR_NoImplicitConv
);
Symbols\SymbolDistinguisherTests.cs (1)
391
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "Lib.M()").WithArguments("S [Metadata, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]", "S [file.cs(2)]").WithLocation(8, 15));
Symbols\SymbolErrorTests.cs (8)
119
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "b").WithArguments("B", "Test"),
150
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "var").WithArguments("TC5<string, string>", "NS.Test"),
172
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "r").WithArguments("System.TypedReference", "object"));
12390
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "0").WithArguments("int", "void"),
15705
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "true").WithArguments("bool", "int"),
15708
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, @"""true""").WithArguments("string", "int"),
21699
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Derived()").WithArguments("Derived", "Test").WithLocation(10, 18)
21794
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "new Derived()").WithArguments("Derived", "Test").WithLocation(10, 18)
Symbols\UserDefinedOperatorErrorTests.cs (1)
161
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "c1").WithArguments("C", "C.D"),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Diagnostics\DiagnosticTest.cs (2)
2211
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "string.Empty").WithArguments("string", "int").WithLocation(7, 17),
2214
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "string.Empty").WithArguments("string", "int").WithLocation(10, 17));
Parsing\UsingDirectiveParsingTests.cs (2)
1711
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "true").WithArguments("bool", "int").WithLocation(5, 12),
1714
Diagnostic(ErrorCode.
ERR_NoImplicitConv
, "false").WithArguments("bool", "int").WithLocation(5, 18));