495 references to ERR_NoImplicitConvCast
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Statements.cs (1)
2279
Error(diagnostics, ErrorCode.
ERR_NoImplicitConvCast
, syntax, distinguisher.First, distinguisher.Second);
Errors\ErrorFacts.cs (1)
831
or ErrorCode.
ERR_NoImplicitConvCast
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (9)
CodeGen\CodeGenNullCoalescingAssignmentTests.cs (1)
2583
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a ??= default(int?)").WithArguments("int?", "int").WithLocation(9, 14));
CodeGen\CodeGenTupleEqualityTests.cs (1)
4845
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a == a").WithArguments("bool?", "bool").WithLocation(7, 13),
CodeGen\CodeGenTupleTest.cs (5)
5612
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "d").WithArguments("(dynamic, dynamic)", "(int, int)").WithLocation(7, 24)
6965
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, @"((long, string))(1, ""hello"")").WithArguments("(long, string)", "(short, string)").WithLocation(10, 30),
6968
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, @"((long c, string d))(1, ""hello"")").WithArguments("(long c, string d)", "(short a, string b)").WithLocation(13, 34),
8010
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "((long c, long d))(e: 1, f:2)").WithArguments("(long c, long d)", "(int a, int b)").WithLocation(7, 29),
8019
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "((int c, int d))(e: 1, f:2)").WithArguments("(int c, int d)", "(short a, short b)").WithLocation(9, 33),
Emit\CompilationEmitTests.cs (2)
1527
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("I<Base>", "I<Derived>").WithLocation(7, 16)
1588
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("I<Derived>", "I<Base>").WithLocation(7, 16)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (69)
Emit\NumericIntPtrTests.cs (69)
2059
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "uint.MaxValue").WithArguments("uint", "nint").WithLocation(15, 17),
2062
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "long.MaxValue").WithArguments("long", "nint").WithLocation(16, 17),
2065
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "ulong.MaxValue").WithArguments("ulong", "nint").WithLocation(17, 17),
2068
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "float.MaxValue").WithArguments("float", "nint").WithLocation(18, 17),
2071
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "double.MaxValue").WithArguments("double", "nint").WithLocation(19, 17),
2074
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(decimal)int.MaxValue").WithArguments("decimal", "nint").WithLocation(20, 17),
2077
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(nuint)uint.MaxValue").WithArguments("nuint", "nint").WithLocation(22, 17),
2080
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "sbyte.MaxValue").WithArguments("sbyte", "nuint").WithLocation(30, 17),
2083
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "short.MaxValue").WithArguments("short", "nuint").WithLocation(33, 17),
2086
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "long.MaxValue").WithArguments("long", "nuint").WithLocation(37, 17),
2089
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "ulong.MaxValue").WithArguments("ulong", "nuint").WithLocation(38, 17),
2092
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "float.MaxValue").WithArguments("float", "nuint").WithLocation(39, 17),
2095
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "double.MaxValue").WithArguments("double", "nuint").WithLocation(40, 17),
2098
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(decimal)uint.MaxValue").WithArguments("decimal", "nuint").WithLocation(41, 17),
2101
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(nint)int.MaxValue").WithArguments("nint", "nuint").WithLocation(42, 17));
2161
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "sbyte").WithLocation(9, 24),
2164
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "byte").WithLocation(10, 22),
2167
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "char").WithLocation(11, 22),
2170
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "short").WithLocation(12, 23),
2173
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "ushort").WithLocation(13, 25),
2176
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "int").WithLocation(14, 21),
2179
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "uint").WithLocation(15, 22),
2182
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "ulong").WithLocation(17, 24),
2185
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "nuint").WithLocation(21, 24),
2188
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "sbyte").WithLocation(29, 24),
2191
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "byte").WithLocation(30, 22),
2194
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "char").WithLocation(31, 22),
2197
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "short").WithLocation(32, 23),
2200
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "ushort").WithLocation(33, 25),
2203
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "int").WithLocation(34, 21),
2206
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "uint").WithLocation(35, 22),
2209
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "long").WithLocation(36, 22),
2212
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "nint").WithLocation(41, 22));
3550
expectedExplicitIL is null ? ErrorCode.ERR_NoImplicitConv : ErrorCode.
ERR_NoImplicitConvCast
:
6930
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "++x").WithArguments("long", "MyInt").WithLocation(5, 9),
6933
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x++").WithArguments("long", "MyInt").WithLocation(6, 9),
6936
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "--x").WithArguments("long", "MyInt").WithLocation(7, 9),
6939
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x--").WithArguments("long", "MyInt").WithLocation(8, 9)
6945
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "++x").WithArguments("long?", "MyInt").WithLocation(5, 9),
6948
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x++").WithArguments("long?", "MyInt").WithLocation(6, 9),
6951
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "--x").WithArguments("long?", "MyInt").WithLocation(7, 9),
6954
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x--").WithArguments("long?", "MyInt").WithLocation(8, 9)
6960
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "++x").WithArguments("ulong", "MyInt").WithLocation(5, 9),
6963
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x++").WithArguments("ulong", "MyInt").WithLocation(6, 9),
6966
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "--x").WithArguments("ulong", "MyInt").WithLocation(7, 9),
6969
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x--").WithArguments("ulong", "MyInt").WithLocation(8, 9),
6978
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "++x").WithArguments("ulong?", "MyInt").WithLocation(5, 9),
6981
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x++").WithArguments("ulong?", "MyInt").WithLocation(6, 9),
6984
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "--x").WithArguments("ulong?", "MyInt").WithLocation(7, 9),
6987
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x--").WithArguments("ulong?", "MyInt").WithLocation(8, 9),
9656
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "i1").WithArguments("nint", "E").WithLocation(10, 13),
9659
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "u1").WithArguments("nuint", "E").WithLocation(18, 13),
9662
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "default(E)").WithArguments("E", "nint").WithLocation(23, 13),
9665
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "E.A").WithArguments("E", "nint").WithLocation(24, 13),
9668
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "E.B").WithArguments("E", "nint").WithLocation(25, 13),
9671
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "default(E)").WithArguments("E", "nuint").WithLocation(30, 13),
9674
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "E.A").WithArguments("E", "nuint").WithLocation(31, 13),
9677
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "E.B").WithArguments("E", "nuint").WithLocation(32, 13));
9981
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("sbyte", "nuint"),
9984
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("short", "nuint"),
9987
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("int", "nuint"),
9990
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("long", "nuint"),
9993
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("nint", "nuint"),
9996
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("sbyte", "nuint"),
9999
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("short", "nuint"),
10002
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("int", "nuint"),
10005
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("long", "nuint"),
10008
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("nint", "nuint"));
10297
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments(AsNative(sourceType), "FinalType")
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (49)
Attributes\AttributeTests_WellKnownAttributes.cs (1)
13930
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining").WithArguments("System.Runtime.CompilerServices.MethodImplOptions", "System.Runtime.CompilerServices.MethodCodeType").WithLocation(6, 70)
FirstClassSpanTests.cs (7)
5649
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("I<string[]>", "I<System.ReadOnlySpan<object>>").WithLocation(5, 49));
5669
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("I<string[]>", "I<System.ReadOnlySpan<object>>").WithLocation(5, 49));
5696
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("I<string>[]", $"System.{type}<I<object>>").WithLocation(6, 12)
5757
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("I<string>[]", "System.ReadOnlySpan<I<object>>").WithLocation(5, 49));
5922
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("T[]", "System.ReadOnlySpan<U>").WithLocation(6, 34),
5925
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("T[]", "System.Span<U>").WithLocation(8, 26));
5952
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("T[]", "System.Span<U>").WithLocation(8, 26)
RefReadonlyParameterTests.cs (24)
1034
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c.D").WithArguments("delegate*<ref int, void>", "delegate*<int, void>").WithLocation(10, 34),
1037
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c.D").WithArguments("delegate*<ref int, void>", "delegate*<in int, void>").WithLocation(12, 37),
1043
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c.D").WithArguments("delegate*<ref int, void>", "delegate*<ref readonly int, void>").WithLocation(13, 48),
1046
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c.D").WithArguments("delegate*<ref int, void>", "delegate*<out int, void>").WithLocation(14, 38));
1058
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c.D").WithArguments("delegate*<ref int, void>", "delegate*<int, void>").WithLocation(10, 34),
1061
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c.D").WithArguments("delegate*<ref int, void>", "delegate*<in int, void>").WithLocation(12, 37),
1064
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c.D").WithArguments("delegate*<ref int, void>", "delegate*<ref readonly int, void>").WithLocation(13, 48),
1067
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c.D").WithArguments("delegate*<ref int, void>", "delegate*<out int, void>").WithLocation(14, 38));
7882
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "rr").WithArguments("delegate*<ref readonly int, void>", "delegate*<int, void>").WithLocation(9, 9),
7885
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "rr").WithArguments("delegate*<ref readonly int, void>", "delegate*<in int, void>").WithLocation(10, 9),
7888
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "rr").WithArguments("delegate*<ref readonly int, void>", "delegate*<ref int, void>").WithLocation(11, 9),
7891
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "rr").WithArguments("delegate*<ref readonly int, void>", "delegate*<out int, void>").WithLocation(12, 9),
7894
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "i").WithArguments("delegate*<in int, void>", "delegate*<ref int, void>").WithLocation(13, 9),
7897
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "r").WithArguments("delegate*<ref int, void>", "delegate*<in int, void>").WithLocation(14, 9),
7900
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "r").WithArguments("delegate*<ref int, void>", "delegate*<ref readonly int, void>").WithLocation(15, 10),
7903
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "i").WithArguments("delegate*<in int, void>", "delegate*<ref readonly int, void>").WithLocation(16, 10),
7906
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "o").WithArguments("delegate*<out int, void>", "delegate*<ref readonly int, void>").WithLocation(17, 10),
7909
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "v").WithArguments("delegate*<int, void>", "delegate*<ref readonly int, void>").WithLocation(18, 10));
8002
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "C.X1").WithArguments("delegate*<ref readonly int, void>", $"delegate*<{modifier} int, void>").WithLocation(13, 12),
8005
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "C.Y1").WithArguments($"delegate*<{modifier} int, void>", "delegate*<ref readonly int, void>").WithLocation(14, 12),
8014
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "C.X1").WithArguments("delegate*<ref readonly int, void>", $"delegate*<{modifier} int, void>").WithLocation(13, 12),
8017
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "C.Y1").WithArguments($"delegate*<{modifier} int, void>", "delegate*<ref readonly int, void>").WithLocation(14, 12)
8072
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "C.X1").WithArguments("delegate*<ref int, void>", "delegate*<in int, void>").WithLocation(13, 12),
8075
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "C.Y1").WithArguments("delegate*<in int, void>", "delegate*<ref int, void>").WithLocation(14, 12)
Semantics\ExtensionOperatorsTests.cs (2)
7956
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "++s2").WithArguments("S1?", "S1").WithLocation(23, 13),
21819
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "s12 " + op + "= s11").WithArguments("S1?", "S1").WithLocation(24, 13)
Semantics\LockTests.cs (2)
4479
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "new Lock()").WithArguments("System.Threading.Lock", "I").WithLocation(4, 7),
4482
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "new Lock()").WithArguments("System.Threading.Lock", "D").WithLocation(7, 7));
Semantics\PatternMatchingTests.cs (7)
4751
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "double.NaN").WithArguments("double", "int?").WithLocation(10, 18),
5321
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "12L").WithArguments("long", "byte").WithLocation(7, 32),
8715
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(object)null").WithArguments("object", "System.ReadOnlySpan<char>").WithLocation(4, 57));
8786
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(object)null").WithArguments("object", "System.ReadOnlySpan<char>").WithLocation(4, 63));
10316
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(object)null").WithArguments("object", "System.Span<char>").WithLocation(4, 49));
10387
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(object)null").WithArguments("object", "System.Span<char>").WithLocation(4, 55));
12357
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1L").WithArguments("long", "byte").WithLocation(4, 41));
Semantics\PatternMatchingTests3.cs (1)
7562
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "100.0").WithArguments("double", type).WithLocation(5, 42));
Semantics\PatternMatchingTests4.cs (1)
3437
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1").WithArguments("int", "int*").WithLocation(6, 18),
Semantics\PatternSwitchTests.cs (2)
1022
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "2").WithArguments("int", "Color").WithLocation(14, 18),
1039
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "2").WithArguments("int", "Color").WithLocation(14, 18),
Semantics\RecordTests.cs (2)
8429
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "s").WithArguments("S", "long").WithLocation(19, 41)
8597
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c with { }").WithArguments("B", "C").WithLocation(13, 13),
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (28)
IOperation\IOperationTests_ArrayCreationAndInitializer.cs (3)
786
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "b").WithArguments("object", "int").WithLocation(6, 38)
883
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "M()").WithArguments("object", "int").WithLocation(6, 38)
950
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "0.0").WithArguments("double", "int").WithLocation(6, 38)
IOperation\IOperationTests_IArrayElementReferenceExpression.cs (1)
499
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c").WithArguments("C", "int").WithLocation(6, 32)
IOperation\IOperationTests_IConversionExpression.cs (17)
135
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "f1").WithArguments("float", "int").WithLocation(7, 28)
253
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "i1").WithArguments("int", "Enum1").WithLocation(7, 30)
288
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1").WithArguments("int", "Enum1").WithLocation(5, 30),
737
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "i1").WithArguments("int?", "int").WithLocation(7, 28)
1033
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "new C1()").WithArguments("C1", "I1").WithLocation(12, 27)
1154
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "i2").WithArguments("I2", "I1").WithLocation(17, 27)
1418
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "new object()").WithArguments("object", "System.Array").WithLocation(8, 30)
1489
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "new object()").WithArguments("object", "System.Collections.Generic.IList<int>").WithLocation(8, 35)
1737
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c2").WithArguments("C2<C4>", "I1<C3>").WithLocation(11, 31)
1831
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c2").WithArguments("C2<C3>", "I1<C4>").WithLocation(11, 31)
2014
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "new T()").WithArguments("T", "I1").WithLocation(11, 27)
2678
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "i1").WithArguments("int", "sbyte").WithLocation(7, 36)
2998
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "v1").WithArguments("void*", "int*").WithLocation(9, 29)
3033
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "0").WithArguments("int", "void*").WithLocation(8, 30),
3214
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "f").WithArguments("float", "int").WithLocation(7, 26)
3582
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(float)1.0").WithArguments("float", "int").WithLocation(6, 27),
4656
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(E1?)e").WithArguments("E1?", "int?").WithLocation(9, 29)
IOperation\IOperationTests_IFixedStatement.cs (1)
379
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "&p1").WithArguments("int**", "int").WithLocation(15, 22)
IOperation\IOperationTests_IIsPatternExpression.cs (1)
244
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "12.0").WithArguments("double", "int?").WithLocation(8, 28)
IOperation\IOperationTests_IPatternSwitchCase.cs (1)
389
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("object", "bool").WithLocation(9, 37)
IOperation\IOperationTests_ISwitchOperation.cs (2)
1225
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1L").WithArguments("long", "int").WithLocation(8, 18)
1889
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "other").WithArguments("int?", "int").WithLocation(8, 18),
IOperation\IOperationTests_StackAllocArrayCreationAndInitializer.cs (2)
538
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "b").WithArguments("object", "int").WithLocation(6, 42),
701
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "0.0").WithArguments("double", "int").WithLocation(6, 42),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (259)
Semantics\ArglistTests.cs (1)
837
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "__refvalue(tr, double)").WithArguments("double", "int"),
Semantics\ConstantTests.cs (4)
3418
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(object)null").WithArguments("object", "string").WithLocation(9, 27),
3421
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, @"(object)""y""").WithArguments("object", "string").WithLocation(10, 27),
3430
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(object)null").WithArguments("object", "string").WithLocation(21, 18),
3433
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, @"(object)""b""").WithArguments("object", "string").WithLocation(23, 18),
Semantics\DeconstructionTests.cs (6)
770
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("int", "byte").WithLocation(8, 20),
4104
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "int y1").WithArguments("dynamic", "int").WithLocation(6, 19),
4113
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "int y2").WithArguments("dynamic", "int").WithLocation(7, 19),
4116
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "int*[] x3").WithArguments("dynamic", "int*[]").WithLocation(8, 10),
4119
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "int y3").WithArguments("dynamic", "int").WithLocation(8, 21),
4128
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "int y4").WithArguments("dynamic", "int").WithLocation(9, 21)
Semantics\DelegateTypeTests.cs (1)
8607
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1.0").WithArguments("double", "int").WithLocation(12, 24),
Semantics\ForEachTests.cs (1)
2965
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "d").WithArguments("Dummy", "System.Collections.IEnumerable").WithLocation(27, 25));
Semantics\ForLoopErrorTests.cs (1)
77
VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "b").WithArguments("bool?", "bool"));
Semantics\FunctionPointerTests.cs (28)
547
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "i").WithArguments("int", "delegate*<void>").WithLocation(12, 31),
550
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "ptr").WithArguments("delegate*<void>", "int").WithLocation(13, 13),
776
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "new S()").WithArguments("S", "delegate*<int*, void>").WithLocation(8, 45)
1037
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<string, string, void>", "delegate*<string, void>").WithLocation(6, 40),
1040
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<string, string, void>", "delegate*<string, string, string, void>").WithLocation(7, 56)
1099
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<ref object, void>", "delegate*<in object, void>").WithLocation(6, 43),
1102
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<ref object, void>", "delegate*<object, void>").WithLocation(7, 40),
1105
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<ref object, void>", "delegate*<ref string, void>").WithLocation(8, 44),
1108
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<ref object, void>", "delegate*<out object, void>").WithLocation(9, 44),
1111
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param2").WithArguments("delegate*<out object, void>", "delegate*<in object, void>").WithLocation(10, 43),
1114
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param2").WithArguments("delegate*<out object, void>", "delegate*<object, void>").WithLocation(11, 40),
1117
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param2").WithArguments("delegate*<out object, void>", "delegate*<ref object, void>").WithLocation(12, 44),
1120
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param2").WithArguments("delegate*<out object, void>", "delegate*<out string, void>").WithLocation(13, 44)
1259
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<ref string>", "delegate*<ref readonly string>").WithLocation(6, 47),
1262
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<ref string>", "delegate*<string>").WithLocation(7, 34),
1265
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<ref string>", "delegate*<object>").WithLocation(8, 34)
1339
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<void>", "delegate* unmanaged[Cdecl]<void>").WithLocation(6, 49),
1342
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<void>", "delegate* unmanaged[Thiscall]<void>").WithLocation(7, 52),
1345
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<void>", "delegate* unmanaged[Stdcall]<void>").WithLocation(8, 51),
1348
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param2").WithArguments("delegate* unmanaged[Thiscall, Stdcall]<void>", "delegate* unmanaged[Thiscall]<void>").WithLocation(9, 52),
1351
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param2").WithArguments("delegate* unmanaged[Thiscall, Stdcall]<void>", "delegate* unmanaged[Stdcall]<void>").WithLocation(10, 51),
1354
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param2").WithArguments("delegate* unmanaged[Thiscall, Stdcall]<void>", "delegate* unmanaged[Thiscall, Cdecl]<void>").WithLocation(11, 59),
1357
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param2").WithArguments("delegate* unmanaged[Thiscall, Stdcall]<void>", "delegate* unmanaged[Cdecl, Stdcall]<void>").WithLocation(12, 58),
1360
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param2").WithArguments("delegate* unmanaged[Thiscall, Stdcall]<void>", "delegate* unmanaged[Thiscall, Stdcall, Cdecl]<void>").WithLocation(13, 68)
1498
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<int, object>", "delegate*<object, string>").WithLocation(6, 42),
1501
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<int, object>", "delegate*<int, string>").WithLocation(7, 39)
1555
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param1").WithArguments("delegate*<delegate*<object, void>, void>", "delegate*<delegate*<string, void>, void>").WithLocation(6, 57),
1558
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "param2").WithArguments("delegate*<delegate*<object>>", "delegate*<delegate*<string>>").WithLocation(7, 45)
Semantics\InterpolationTests.cs (1)
651
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1E10").WithArguments("double", "int").WithLocation(5, 22),
Semantics\IteratorTests.cs (1)
183
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1.1").WithArguments("double", "int").WithLocation(7, 22)
Semantics\LambdaTests.cs (5)
214
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "123.456").WithArguments("double", "int").WithLocation(58, 29),
220
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1m").WithArguments("decimal", "double").WithLocation(62, 51),
5545
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "t").WithArguments("T", "U").WithLocation(8, 30),
5576
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "t").WithArguments("T", "U").WithLocation(9, 21),
5601
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "t").WithArguments("T", "U").WithLocation(7, 54),
Semantics\LocalFunctionTests.cs (4)
7087
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("object", "C1.var").WithLocation(7, 37),
7090
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("object", "C1.var").WithLocation(8, 44),
7093
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("object", "string").WithLocation(18, 41),
7096
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("object", "string").WithLocation(19, 48));
Semantics\NameCollisionTests.cs (4)
1782
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "M(x1 => { })").WithArguments("long", "int").WithLocation(10, 22),
1791
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "M(x2 => { })").WithArguments("long", "int").WithLocation(16, 22),
1800
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "M(x1 => { })").WithArguments("long", "int").WithLocation(10, 22),
1806
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "M(x2 => { })").WithArguments("long", "int").WithLocation(16, 22),
Semantics\NativeIntegerTests.cs (81)
5125
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "F1").WithArguments("System.IntPtr", "long").WithLocation(9, 18),
5128
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "F2").WithArguments("System.UIntPtr", "ulong").WithLocation(10, 19),
5131
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "F3").WithArguments("System.IntPtr?", "long?").WithLocation(11, 19),
5134
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "F4").WithArguments("System.UIntPtr?", "ulong?").WithLocation(12, 20),
5137
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("int", "System.IntPtr").WithLocation(16, 14),
5140
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("uint", "System.UIntPtr").WithLocation(17, 14),
5143
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "z").WithArguments("int?", "System.IntPtr?").WithLocation(18, 14),
5146
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "w").WithArguments("uint?", "System.UIntPtr?").WithLocation(19, 14)
5815
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "sbyte.MaxValue").WithArguments("sbyte", "nuint").WithLocation(5, 14),
5818
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "short.MaxValue").WithArguments("short", "nuint").WithLocation(8, 14),
5821
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "sbyte.MaxValue").WithArguments("sbyte", "nuint?").WithLocation(11, 14),
5824
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "short.MaxValue").WithArguments("short", "nuint?").WithLocation(14, 14)
6195
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "uint.MaxValue").WithArguments("uint", "nint").WithLocation(15, 17),
6198
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "long.MaxValue").WithArguments("long", "nint").WithLocation(16, 17),
6201
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "ulong.MaxValue").WithArguments("ulong", "nint").WithLocation(17, 17),
6204
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "float.MaxValue").WithArguments("float", "nint").WithLocation(18, 17),
6207
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "double.MaxValue").WithArguments("double", "nint").WithLocation(19, 17),
6210
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(decimal)int.MaxValue").WithArguments("decimal", "nint").WithLocation(20, 17),
6213
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(nuint)uint.MaxValue").WithArguments("nuint", "nint").WithLocation(22, 17),
6216
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "sbyte.MaxValue").WithArguments("sbyte", "nuint").WithLocation(30, 17),
6219
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "short.MaxValue").WithArguments("short", "nuint").WithLocation(33, 17),
6222
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "long.MaxValue").WithArguments("long", "nuint").WithLocation(37, 17),
6225
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "ulong.MaxValue").WithArguments("ulong", "nuint").WithLocation(38, 17),
6228
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "float.MaxValue").WithArguments("float", "nuint").WithLocation(39, 17),
6231
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "double.MaxValue").WithArguments("double", "nuint").WithLocation(40, 17),
6234
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(decimal)uint.MaxValue").WithArguments("decimal", "nuint").WithLocation(41, 17),
6237
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(nint)int.MaxValue").WithArguments("nint", "nuint").WithLocation(42, 17));
6295
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "sbyte").WithLocation(9, 24),
6298
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "byte").WithLocation(10, 22),
6301
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "char").WithLocation(11, 22),
6304
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "short").WithLocation(12, 23),
6307
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "ushort").WithLocation(13, 25),
6310
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "int").WithLocation(14, 21),
6313
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "uint").WithLocation(15, 22),
6316
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "ulong").WithLocation(17, 24),
6319
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "n").WithArguments("nint", "nuint").WithLocation(21, 24),
6322
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "sbyte").WithLocation(29, 24),
6325
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "byte").WithLocation(30, 22),
6328
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "char").WithLocation(31, 22),
6331
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "short").WithLocation(32, 23),
6334
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "ushort").WithLocation(33, 25),
6337
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "int").WithLocation(34, 21),
6340
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "uint").WithLocation(35, 22),
6343
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "long").WithLocation(36, 22),
6346
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nu").WithArguments("nuint", "nint").WithLocation(41, 22));
7852
expectedExplicitIL is null ? ErrorCode.ERR_NoImplicitConv : ErrorCode.
ERR_NoImplicitConvCast
:
10408
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "++x").WithArguments("long", "MyInt").WithLocation(5, 9),
10411
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x++").WithArguments("long", "MyInt").WithLocation(6, 9),
10414
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "--x").WithArguments("long", "MyInt").WithLocation(7, 9),
10417
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x--").WithArguments("long", "MyInt").WithLocation(8, 9)
10423
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "++x").WithArguments("long?", "MyInt").WithLocation(5, 9),
10426
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x++").WithArguments("long?", "MyInt").WithLocation(6, 9),
10429
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "--x").WithArguments("long?", "MyInt").WithLocation(7, 9),
10432
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x--").WithArguments("long?", "MyInt").WithLocation(8, 9)
10438
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "++x").WithArguments("ulong", "MyInt").WithLocation(5, 9),
10441
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x++").WithArguments("ulong", "MyInt").WithLocation(6, 9),
10444
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "--x").WithArguments("ulong", "MyInt").WithLocation(7, 9),
10447
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x--").WithArguments("ulong", "MyInt").WithLocation(8, 9),
10456
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "++x").WithArguments("ulong?", "MyInt").WithLocation(5, 9),
10459
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x++").WithArguments("ulong?", "MyInt").WithLocation(6, 9),
10462
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "--x").WithArguments("ulong?", "MyInt").WithLocation(7, 9),
10465
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x--").WithArguments("ulong?", "MyInt").WithLocation(8, 9),
14019
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "i1").WithArguments("nint", "E").WithLocation(10, 13),
14022
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "u1").WithArguments("nuint", "E").WithLocation(18, 13),
14025
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "default(E)").WithArguments("E", "nint").WithLocation(23, 13),
14028
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "E.A").WithArguments("E", "nint").WithLocation(24, 13),
14031
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "E.B").WithArguments("E", "nint").WithLocation(25, 13),
14034
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "default(E)").WithArguments("E", "nuint").WithLocation(30, 13),
14037
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "E.A").WithArguments("E", "nuint").WithLocation(31, 13),
14040
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "E.B").WithArguments("E", "nuint").WithLocation(32, 13));
14773
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("sbyte", "nuint").WithLocation(3, 40),
14776
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("short", "nuint").WithLocation(4, 40),
14779
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("int", "nuint").WithLocation(5, 38),
14782
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("long", "nuint").WithLocation(6, 39),
14785
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("nint", "nuint").WithLocation(7, 39),
14788
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("sbyte", "nuint").WithLocation(8, 47),
14791
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("short", "nuint").WithLocation(9, 47),
14794
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("int", "nuint").WithLocation(10, 45),
14797
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("long", "nuint").WithLocation(11, 46),
14800
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("nint", "nuint").WithLocation(12, 46));
15086
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments(sourceType, "FinalType")
Semantics\NullableReferenceTypesTests.cs (30)
4402
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x1").WithArguments("Base", "Outer").WithLocation(6, 19),
4677
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y2").WithArguments("object", "T").WithLocation(11, 14),
4683
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y4").WithArguments("object", "string").WithLocation(21, 14),
82389
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "default(T)").WithArguments("T", "System.Collections.Generic.IEnumerator<T>").WithLocation(4, 37),
83495
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "new S<object>()").WithArguments("S<object>", "bool").WithLocation(6, 18));
87048
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x1").WithArguments("long", "int?").WithLocation(5, 19),
87051
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x2").WithArguments("long?", "int?").WithLocation(10, 19),
87057
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x3").WithArguments("long?", "int?").WithLocation(16, 19)
95712
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "o").WithArguments("object", "IB").WithLocation(16, 13),
96239
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "t").WithArguments("(B, (A, A))", "(A, (B, B))").WithLocation(22, 13),
117142
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("object", "T").WithLocation(7, 13),
117145
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("object", "T").WithLocation(8, 13),
117202
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("object", "T").WithLocation(7, 13),
117205
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("object", "T").WithLocation(8, 13),
117263
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("object", "T").WithLocation(7, 13),
117266
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("object", "T").WithLocation(8, 13),
117319
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("T", "U").WithLocation(7, 13),
117346
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("T", "U").WithLocation(7, 13),
117373
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("T", "U").WithLocation(7, 13),
117400
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("T", "U").WithLocation(7, 13)
117424
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("object", "T").WithLocation(8, 13)
117702
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("Outer", "T").WithLocation(7, 13),
117705
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("Outer", "T").WithLocation(8, 13),
117732
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("Outer", "T").WithLocation(8, 13)
117760
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("Outer", "T").WithLocation(7, 13),
117766
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("Outer", "T").WithLocation(8, 13),
117796
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("Outer", "T").WithLocation(8, 13)
127240
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("T?", "T").WithLocation(5, 15),
160857
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("bool?", "bool").WithLocation(7, 13),
160863
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("bool?", "bool").WithLocation(12, 13),
Semantics\NullableTests.cs (1)
141
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c++").WithArguments("int?", "C")
Semantics\OperatorTests.cs (4)
2425
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a += b").WithArguments("int?", "int").WithLocation(6, 19)
3105
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "i32 += i64").WithArguments("long", "int").WithLocation(34, 9),
3108
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "d += c").WithArguments("C", "C.D").WithLocation(39, 9));
6215
CreateCompilation(text).VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "b++").WithArguments("A", "B"));
Semantics\RawInterpolationTests.cs (1)
666
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1E10").WithArguments("double", "int").WithLocation(5, 24),
Semantics\RefLocalsAndReturnsTests.cs (5)
2774
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a[ref i]").WithArguments("object", "int").WithLocation(7, 13),
2780
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a[out i]").WithArguments("object", "int").WithLocation(8, 13),
2789
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a2[i, out i]").WithArguments("object", "int").WithLocation(10, 13),
2795
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a2[i, ref i]").WithArguments("object", "int").WithLocation(11, 13),
2801
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a2[ref i, out i]").WithArguments("object", "int").WithLocation(12, 13),
Semantics\ScriptSemanticsTests.cs (1)
937
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "42l").WithArguments("long", "int"));
Semantics\SemanticAnalyzerTests.cs (21)
720
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "l1").WithArguments("long", "int").WithLocation(34, 18),
1140
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(char)(One - 1)").WithArguments("char", "E").WithLocation(12, 13),
1143
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(F)(One - 1)").WithArguments("F", "E").WithLocation(25, 13),
1146
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "Null").WithArguments("object", "E").WithLocation(26, 13),
1152
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "F.Zero").WithArguments("F", "E").WithLocation(30, 13),
1158
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(char)One").WithArguments("char", "E").WithLocation(33, 13),
1161
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(sbyte)One").WithArguments("sbyte", "E").WithLocation(34, 13),
1164
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(byte)One").WithArguments("byte", "E").WithLocation(35, 13),
1167
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(short)One").WithArguments("short", "E").WithLocation(36, 13),
1170
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(ushort)One").WithArguments("ushort", "E").WithLocation(37, 13),
1173
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(int)One").WithArguments("int", "E").WithLocation(38, 13),
1176
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(uint)One").WithArguments("uint", "E").WithLocation(39, 13),
1179
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(long)One").WithArguments("long", "E").WithLocation(40, 13),
1182
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(ulong)One").WithArguments("ulong", "E").WithLocation(41, 13),
1185
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(decimal)One").WithArguments("decimal", "E").WithLocation(42, 13),
1188
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(float)One").WithArguments("float", "E").WithLocation(43, 13),
1191
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(double)One").WithArguments("double", "E").WithLocation(44, 13),
1194
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(F)One").WithArguments("F", "E").WithLocation(46, 13),
1197
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "new object()").WithArguments("object", "E").WithLocation(47, 13),
1200
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1").WithArguments("int", "E").WithLocation(48, 13),
1203
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "F.One").WithArguments("F", "E").WithLocation(50, 13));
Semantics\SemanticErrorTests.cs (22)
165
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "Delegate.Combine(arrfoo)").WithArguments("System.Delegate", "boo"),
168
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "Delegate.Combine(goo, goo1)").WithArguments("System.Delegate", "boo")
3872
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "C.F()").WithArguments("E", "int").WithLocation(4, 9),
4736
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "new Explicit()").WithArguments("Explicit", "System.Exception").WithLocation(9, 26)
9150
new ErrorDescription[] { new ErrorDescription { Code = (int)ErrorCode.
ERR_NoImplicitConvCast
, Line = 8, Column = 27 } });
9165
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "0L").WithArguments("long", "int").WithLocation(3, 19));
9183
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1L").WithArguments("long", "short").WithLocation(5, 25),
9208
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "2").WithArguments("int", "E").WithLocation(4, 11),
9211
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "'c'").WithArguments("char", "E").WithLocation(9, 13),
9233
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "'a'").WithArguments("char", "byte").WithLocation(3, 9));
9249
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1L").WithArguments("long", "int").WithLocation(4, 9));
9288
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "G.A").WithArguments("long", "int").WithLocation(5, 9),
9291
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "G.B").WithArguments("long", "int").WithLocation(6, 9));
9314
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1L").WithArguments("long", "int").WithLocation(11, 26));
9330
VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "b").WithArguments("bool?", "bool"));
9354
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "Number.One").WithArguments("Number", "int").WithLocation(6, 28));
9381
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("double", "int").WithLocation(7, 30),
9384
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("float", "int").WithLocation(10, 30),
9387
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "z").WithArguments("decimal", "int").WithLocation(13, 30));
9406
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "o").WithArguments("object", "int").WithLocation(6, 15));
9427
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "o").WithArguments("object", "int").WithLocation(6, 13),
16024
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1.0").WithArguments("double", "int").WithLocation(9, 49),
Semantics\SwitchTests.cs (8)
264
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "97.0f").WithArguments("float", "char").WithLocation(32, 18),
267
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "97.0f").WithArguments("float", "char").WithLocation(34, 18),
276
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "97").WithArguments("int", "char").WithLocation(38, 18),
290
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "97.0f").WithArguments("float", "char").WithLocation(32, 18),
293
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "97.0f").WithArguments("float", "char").WithLocation(34, 18),
302
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "97").WithArguments("int", "char").WithLocation(38, 18),
1086
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1.2f").WithArguments("float", "int").WithLocation(10, 12)
1091
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1.2f").WithArguments("float", "int").WithLocation(10, 12)
Semantics\TargetTypedConditionalOperatorTests.cs (4)
30
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "b ? 1 : 2").WithArguments("int", "short").WithLocation(6, 26));
47
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "b ? 0 : 0").WithArguments("int", "color").WithLocation(6, 19));
83
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "b ? 1000000 : 2").WithArguments("int", "short").WithLocation(6, 26)
107
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "b ? 1 : 0").WithArguments("int", "color").WithLocation(6, 19)
Semantics\UnsafeTests.cs (8)
8419
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "vv3").WithArguments("void*", "void**"));
8747
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a").WithArguments("System.Array", "int*[]"),
8750
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a").WithArguments("System.Array", "void*[]"),
9989
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "s").WithArguments("char*", "int*"));
10094
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a").WithArguments("char*", "int*"));
10124
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a").WithArguments("char*", "int*"));
11083
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1L").WithArguments("long", "int").WithLocation(7, 35),
12605
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "&s.Buf").WithArguments("int**", "int*").WithLocation(14, 18),
Semantics\UserDefinedConversionTests.cs (1)
1679
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "i").WithArguments("int?", "C").WithLocation(3, 7)
Semantics\Utf8StringsLiteralsTests.cs (9)
146
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nullConstant").WithArguments("object", "byte[]").WithLocation(10, 30),
149
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nullConstant").WithArguments("object", "System.Span<byte>").WithLocation(11, 34),
152
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nullConstant").WithArguments("object", "System.Span<byte>").WithLocation(11, 34),
155
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nullConstant").WithArguments("object", "System.ReadOnlySpan<byte>").WithLocation(12, 42),
158
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nullConstant").WithArguments("object", "System.ReadOnlySpan<byte>").WithLocation(12, 42)
2336
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, @"""cat""u8").WithArguments("System.ReadOnlySpan<byte>", "C3").WithLocation(9, 16)
2487
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nullValue").WithArguments("object", "byte[]").WithLocation(9, 24),
2490
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nullValue").WithArguments("object", "System.Span<byte>").WithLocation(10, 27),
2493
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "nullValue").WithArguments("object", "System.ReadOnlySpan<byte>").WithLocation(11, 43)
Semantics\VarianceTests.cs (6)
117
Assert.Equal(ErrorCode.
ERR_NoImplicitConvCast
, (ErrorCode)errors.Single().Code);
233
Assert.True(code == ErrorCode.
ERR_NoImplicitConvCast
|| code == ErrorCode.ERR_NoImplicitConv, "Unexpected error code " + code);
300
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "bar").WithArguments("IC<double>", "IN<IC<string>>"));
336
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "new X ()").WithArguments("X", "A<Y>")
373
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a").WithArguments("A", "N<X>"));
415
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "a").WithArguments("A", "N<X>"));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (79)
BadSymbolReference.cs (9)
983
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y4").WithArguments("T", "ErrorTest.I1<ErrorTest.I2>"),
989
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y5").WithArguments("ErrorTest.I5", "ErrorTest.I1<ErrorTest.I2>"),
995
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y3").WithArguments("T", "ErrorTest.I1<ErrorTest.I2>"),
1001
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("ErrorTest.C4", "ErrorTest.I1<ErrorTest.I2>")
1199
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c13").WithArguments("ErrorTest.C13", "ErrorTest.I1"),
1205
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("ErrorTest.C4", "ErrorTest.I1"),
1211
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y3").WithArguments("T", "ErrorTest.I1"),
1229
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y4").WithArguments("T", "ErrorTest.I1"),
1278
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "c13").WithArguments("ErrorTest.C13", "ErrorTest.I1"),
Symbols\CheckedUserDefinedOperatorsTests.cs (6)
5357
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("C0", "long").WithLocation(25, 26),
5360
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("C0", "long").WithLocation(30, 28),
5363
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("C0", "int").WithLocation(35, 26),
5366
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("C0", "int").WithLocation(40, 28)
5649
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("C0", "long").WithLocation(10, 26),
5658
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("C0", "int").WithLocation(25, 26),
Symbols\ConversionTests.cs (1)
1122
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "b").WithArguments("B", "A"));
Symbols\GenericConstraintConversionTests.cs (58)
59
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "u").WithArguments("U", "IB").WithLocation(25, 14),
61
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "v").WithArguments("V", "IB").WithLocation(26, 14),
95
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "t").WithArguments("T", "IB").WithLocation(17, 14));
141
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "u").WithArguments("U", "IA").WithLocation(15, 13),
143
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "t").WithArguments("T", "IB").WithLocation(16, 13),
145
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("X", "IB").WithLocation(22, 13),
147
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("X", "IA").WithLocation(26, 13));
216
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "u").WithArguments("U", "T").WithLocation(11, 13),
218
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "v").WithArguments("V", "T").WithLocation(12, 13),
220
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "w").WithArguments("W", "T").WithLocation(13, 13),
224
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "w").WithArguments("W", "U").WithLocation(16, 13),
232
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "t").WithArguments("T", "X").WithLocation(30, 13),
234
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "u").WithArguments("U", "X").WithLocation(31, 13),
236
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "v").WithArguments("V", "X").WithLocation(32, 13),
238
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "w").WithArguments("W", "X").WithLocation(33, 13),
246
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "u").WithArguments("U", "X").WithLocation(42, 13),
250
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "w").WithArguments("W", "X").WithLocation(44, 13),
256
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "u").WithArguments("U", "X").WithLocation(53, 13),
258
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "v").WithArguments("V", "X").WithLocation(54, 13),
260
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "w").WithArguments("W", "X").WithLocation(55, 13));
335
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "t").WithArguments("T", "IB").WithLocation(15, 13));
416
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("Y", "IIn<T>").WithLocation(20, 14),
418
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("X", "IOut<U>").WithLocation(30, 14),
420
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("Y", "IIn<T>").WithLocation(38, 14),
422
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("X", "IOut<U>").WithLocation(48, 14),
424
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "y").WithArguments("Y", "IIn<T>").WithLocation(56, 14),
426
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("X", "IOut<U>").WithLocation(66, 14));
536
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("I<U>", "I<T>").WithLocation(9, 14),
538
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("I<T>", "I<U>").WithLocation(10, 14),
540
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("IIn<U>", "IIn<T>").WithLocation(14, 14),
542
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("IIn<T>", "IIn<U>").WithLocation(15, 14),
544
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("IOut<U>", "IOut<T>").WithLocation(19, 14),
546
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("IOut<T>", "IOut<U>").WithLocation(20, 14),
548
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("I<U>", "I<T>").WithLocation(29, 14),
550
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("I<T>", "I<U>").WithLocation(30, 14),
552
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("IIn<U>", "IIn<T>").WithLocation(34, 14),
554
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("IIn<T>", "IIn<U>").WithLocation(35, 14),
556
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("IOut<U>", "IOut<T>").WithLocation(39, 14),
558
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("IOut<T>", "IOut<U>").WithLocation(40, 14),
560
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("I<U>", "I<T>").WithLocation(49, 14),
562
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("I<T>", "I<U>").WithLocation(50, 14),
564
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("IIn<U>", "IIn<T>").WithLocation(54, 14),
566
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("IOut<T>", "IOut<U>").WithLocation(60, 14),
568
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("I<U>", "I<T>").WithLocation(68, 14),
570
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("I<T>", "I<U>").WithLocation(69, 14),
572
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("IIn<U>", "IIn<T>").WithLocation(73, 14),
574
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("IIn<T>", "IIn<U>").WithLocation(74, 14),
576
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("IOut<U>", "IOut<T>").WithLocation(78, 14),
578
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("IOut<T>", "IOut<U>").WithLocation(79, 14),
580
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("I<U>", "I<T>").WithLocation(88, 14),
582
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("I<T>", "I<U>").WithLocation(89, 14),
584
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("IIn<U>", "IIn<T>").WithLocation(93, 14),
586
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("IIn<T>", "IIn<U>").WithLocation(94, 14),
588
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "iu").WithArguments("IOut<U>", "IOut<T>").WithLocation(98, 14),
590
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "it").WithArguments("IOut<T>", "IOut<U>").WithLocation(99, 14));
609
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "u").WithArguments("U", "X").WithLocation(8, 13));
630
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "t").WithArguments("T", "Y").WithLocation(10, 13));
657
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "t").WithArguments("T", "I").WithLocation(10, 13));
Symbols\Source\EnumTests.cs (2)
89
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "2.2").WithArguments("double", "byte").WithLocation(4, 10),
860
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "(E3)e").WithArguments("Test.E3", "int"));
Symbols\StaticAbstractMembersInInterfacesTests.cs (1)
31704
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "x").WithArguments("int", "T").WithLocation(14, 16)
Symbols\SymbolDistinguisherTests.cs (1)
357
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "Lib.M()").WithArguments("I [Metadata, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]", "I [file.cs(2)]").WithLocation(8, 15));
Symbols\SymbolErrorTests.cs (1)
15702
Diagnostic(ErrorCode.
ERR_NoImplicitConvCast
, "1.2").WithArguments("double", "int"),