189 references to ERR_NoExplicitConv
Microsoft.CodeAnalysis.CSharp (6)
Binder\Binder_Expressions.cs (4)
2555
diagnostics.Add(ErrorCode.
ERR_NoExplicitConv
, syntax.Location, distinguisher1.First, distinguisher1.Second);
2568
diagnostics.Add(ErrorCode.
ERR_NoExplicitConv
, syntax.Location, MessageID.IDS_SK_METHOD.Localize(), targetType);
2625
diagnostics.Add(ErrorCode.
ERR_NoExplicitConv
, syntax.Location, distinguisher.First, distinguisher.Second);
5892
Error(diagnostics, ErrorCode.
ERR_NoExplicitConv
, node, distinguisher.First, distinguisher.Second);
Binder\ForEachLoopBinder.cs (1)
468
diagnostics.Add(ErrorCode.
ERR_NoExplicitConv
, foreachKeyword.GetLocation(), distinguisher.First, distinguisher.Second);
Errors\ErrorFacts.cs (1)
599
case ErrorCode.
ERR_NoExplicitConv
:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (13)
CodeGen\CodeGenAwaitForeachTests.cs (2)
931
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "foreach").WithArguments("int", "string").WithLocation(6, 15)
983
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "foreach").WithArguments("int", "Element").WithLocation(7, 15)
CodeGen\CodeGenMscorlib.cs (2)
381
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(object)__makeref(result)").WithArguments("System.TypedReference", "object").WithLocation(11, 15)
440
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(object)__makeref(result)").WithArguments("System.TypedReference", "object").WithLocation(11, 15)
CodeGen\CodeGenTupleTest.cs (9)
7105
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "((int, int))(1, 1, 1)").WithArguments("(int, int, int)", "(int, int)").WithLocation(9, 13),
7108
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"""string""").WithArguments("string", "int").WithLocation(10, 29),
8028
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"""qq""").WithArguments("string", "long").WithLocation(12, 56),
17969
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C1)x").WithArguments("(int, (int, (int, (int, (int, (int, int))))))", "C.C1").WithLocation(8, 16),
17972
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "((int, (int, int)))y").WithArguments("C.C1", "(int, (int, int))").WithLocation(13, 32),
17975
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "((int, (int, (int, (int, (int, (int, (int, (int, (int, (int, (int, int))))))))))))y").WithArguments("C.C1", "(int, (int, (int, (int, (int, (int, (int, (int, (int, (int, (int, int)))))))))))").WithLocation(16, 96)
18182
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"((int, C1)?)
18675
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "((B, B))xt").WithArguments("(int, int)", "(B, B)").WithLocation(31, 14),
18678
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "((B, B)?)xt").WithArguments("(int, int)", "(B, B)?").WithLocation(34, 14)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Attributes\AttributeTests_WellKnownAttributes.cs (1)
4474
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "new I()").WithArguments("System.StackOverflowException", "I").WithLocation(14, 17));
Emit\NumericIntPtrTests.cs (3)
3521
expectedErrorCode: expectedExplicitIL is null ? ErrorCode.
ERR_NoExplicitConv
: 0);
3532
expectedErrorCode: expectedCheckedIL is null ? ErrorCode.
ERR_NoExplicitConv
: 0);
10249
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(FinalType)x").WithArguments(AsNative(sourceType), "FinalType")
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (13)
IOperation\IOperationTests_ArrayCreationAndInitializer.cs (1)
919
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int)M()").WithArguments("C", "int").WithLocation(6, 38)
IOperation\IOperationTests_IConversionExpression.cs (10)
3887
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C2)c1").WithArguments("C1", "C2").WithLocation(7, 27)
3981
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C1)i1").WithArguments("I1", "C1").WithLocation(9, 27)
4111
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C2[])c1arr").WithArguments("C1[]", "C2[]").WithLocation(7, 32)
4143
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C1[][])c1arr").WithArguments("C1[]", "C1[][]").WithLocation(7, 34)
4239
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(IList<C1>)c1arr").WithArguments("C1[][]", "System.Collections.Generic.IList<C1>").WithLocation(10, 38)
4305
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C1[][])c1List").WithArguments("System.Collections.Generic.IList<C1>", "C1[][]").WithLocation(10, 34)
4649
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(S1)i").WithArguments("I1", "S1").WithLocation(9, 27)
4746
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(T)u").WithArguments("U", "T").WithLocation(8, 25)
4965
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(int)""""").WithArguments("string", "int").WithLocation(8, 26)
5096
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(Action<int>)objectAction").WithArguments("System.Action<object>", "System.Action<int>").WithLocation(8, 43)
IOperation\IOperationTests_InvalidExpression.cs (1)
245
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(Program)x.i1").WithArguments("int", "Program").WithLocation(10, 31),
IOperation\IOperationTests_StackAllocArrayCreationAndInitializer.cs (1)
672
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int)M()").WithArguments("C", "int").WithLocation(6, 42)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (130)
Semantics\ArglistTests.cs (1)
582
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(object)new System.ArgIterator()").WithArguments("System.ArgIterator", "object").WithLocation(31, 23),
Semantics\DelegateTypeTests.cs (29)
179
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(object)Main").WithArguments("method", "object").WithLocation(6, 17),
182
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(ICloneable)Main").WithArguments("method", "System.ICloneable").WithLocation(7, 17),
185
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(Delegate)Main").WithArguments("method", "System.Delegate").WithLocation(8, 17),
188
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(MulticastDelegate)Main").WithArguments("method", "System.MulticastDelegate").WithLocation(9, 17));
224
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(System.Linq.Expressions.Expression)F").WithArguments("method", "System.Linq.Expressions.Expression").WithLocation(6, 13),
230
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(System.Linq.Expressions.LambdaExpression)F").WithArguments("method", "System.Linq.Expressions.LambdaExpression").WithLocation(8, 13));
764
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, $"(System.Delegate){methodGroupExpression}").WithArguments("method", "System.Delegate").WithLocation(6, 20)
1493
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(object)GetValue").WithArguments("method", "object").WithLocation(8, 13),
1502
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(object)GetValue").WithArguments("method", "object").WithLocation(12, 13));
1542
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(object)F").WithArguments("method", "object").WithLocation(5, 27),
1548
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(object)F").WithArguments("method", "object").WithLocation(7, 33));
1588
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(object)F").WithArguments("method", "object").WithLocation(6, 33),
1714
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(System.Delegate)p.F").WithArguments("method", "System.Delegate").WithLocation(8, 20));
11626
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C1)F").WithArguments("method", "C1").WithLocation(21, 13),
11629
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C2)F").WithArguments("method", "C2").WithLocation(22, 13)
11715
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C1)F").WithArguments("method", "C1").WithLocation(34, 13),
11718
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C2)F").WithArguments("method", "C2").WithLocation(35, 13)
11775
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C<object>)F").WithArguments("method", "C<object>").WithLocation(17, 13),
11778
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C<ICloneable>)F").WithArguments("method", "C<System.ICloneable>").WithLocation(18, 13)
11852
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C<Delegate>)F").WithArguments("method", "C<System.Delegate>").WithLocation(22, 13),
11855
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C<MulticastDelegate>)F").WithArguments("method", "C<System.MulticastDelegate>").WithLocation(23, 13)
11940
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C1)F").WithArguments("method", "C1").WithLocation(17, 13),
11943
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C2)F").WithArguments("method", "C2").WithLocation(18, 13)
12005
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C1)F").WithArguments("method", "C1").WithLocation(28, 13),
12008
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C2)F").WithArguments("method", "C2").WithLocation(29, 13)
12049
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C<object>)F").WithArguments("method", "C<object>").WithLocation(13, 13),
12052
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C<ICloneable>)F").WithArguments("method", "C<System.ICloneable>").WithLocation(14, 13)
12102
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C<Delegate>)F").WithArguments("method", "C<System.Delegate>").WithLocation(16, 13),
12105
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C<MulticastDelegate>)F").WithArguments("method", "C<System.MulticastDelegate>").WithLocation(17, 13)
Semantics\DynamicTests.cs (1)
41
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)d").WithArguments("dynamic", "int*"));
Semantics\ForEachTests.cs (5)
160
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "foreach").WithArguments("string", "int"));
906
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "foreach").WithArguments("int", "S").WithLocation(31, 9),
908
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "foreach").WithArguments("int", "string").WithLocation(32, 9));
1140
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "foreach").WithArguments("?", "int"));
1165
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "foreach").WithArguments("int", "void").WithLocation(6, 9)
Semantics\FunctionPointerTests.cs (2)
3117
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(dynamic)ptr").WithArguments("delegate*<void>", "dynamic").WithLocation(7, 13),
3123
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(delegate*<void>)d").WithArguments("dynamic", "delegate*<void>").WithLocation(9, 15)
Semantics\InterpolationTests.cs (1)
4251
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(S)$""""").WithArguments("string", "S").WithLocation(8, 25)
Semantics\MultiDimensionalArrayTests.cs (2)
479
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(double[])t.Test1()").WithArguments("double[*]", "double[]").WithLocation(7, 23),
488
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(System.Collections.Generic.IList<double>)t.Test1()").WithArguments("double[*]", "System.Collections.Generic.IList<double>").WithLocation(11, 18),
Semantics\NativeIntegerTests.cs (3)
7832
expectedExplicitIL is null ? ErrorCode.
ERR_NoExplicitConv
: 0);
7843
expectedCheckedIL is null ? ErrorCode.
ERR_NoExplicitConv
: 0);
15047
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(FinalType)x").WithArguments(sourceType, "FinalType")
Semantics\NullableReferenceTypesTests.cs (3)
126068
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int?)x").WithArguments("U", "int?").WithLocation(11, 14),
126077
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int?)x").WithArguments("U", "int?").WithLocation(20, 14));
126585
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(S?)F").WithArguments("method", "S?").WithLocation(6, 18));
Semantics\SemanticErrorTests.cs (2)
1678
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(iii)0").WithArguments("int", "x.iii"));
1731
CreateCompilation(text).VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "foreach").WithArguments("int[]", "int"));
Semantics\UnsafeTests.cs (37)
5722
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(bool)pi").WithArguments("int*", "bool"),
5725
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(char)pi").WithArguments("int*", "char"),
5728
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(double)pi").WithArguments("int*", "double"),
5731
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(decimal)pi").WithArguments("int*", "decimal"),
5734
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(float)pi").WithArguments("int*", "float"),
5737
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(bool)pv").WithArguments("void*", "bool"),
5740
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(char)pv").WithArguments("void*", "char"),
5743
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(double)pv").WithArguments("void*", "double"),
5746
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(decimal)pv").WithArguments("void*", "decimal"),
5749
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(float)pv").WithArguments("void*", "float"),
5752
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)b").WithArguments("bool", "int*"),
5755
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)c").WithArguments("char", "int*"),
5758
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)d").WithArguments("double", "int*"),
5761
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)d").WithArguments("double", "int*"),
5764
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)f").WithArguments("float", "int*"),
5767
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)b").WithArguments("bool", "void*"),
5770
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)c").WithArguments("char", "void*"),
5773
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)d").WithArguments("double", "void*"),
5776
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)e").WithArguments("decimal", "void*"),
5779
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)f").WithArguments("float", "void*"));
5832
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)sb").WithArguments("sbyte?", "int*"),
5835
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)b").WithArguments("byte?", "int*"),
5838
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)s").WithArguments("short?", "int*"),
5841
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)us").WithArguments("ushort?", "int*"),
5844
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)i").WithArguments("int?", "int*"),
5847
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)ui").WithArguments("uint?", "int*"),
5850
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)l").WithArguments("long?", "int*"),
5853
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)ul").WithArguments("ulong?", "int*"),
5856
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)sb").WithArguments("sbyte?", "void*"),
5859
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)b").WithArguments("byte?", "void*"),
5862
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)s").WithArguments("short?", "void*"),
5865
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)us").WithArguments("ushort?", "void*"),
5868
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)i").WithArguments("int?", "void*"),
5871
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)ui").WithArguments("uint?", "void*"),
5874
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)l").WithArguments("long?", "void*"),
5877
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(void*)ul").WithArguments("ulong?", "void*"));
9162
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int*)obj").WithArguments("object", "int*"));
Semantics\UserDefinedConversionTests.cs (2)
487
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(X<T>)t").WithArguments("T", "X<T>"));
1645
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C<object>) M1()").WithArguments("void", "C<object>").WithLocation(9, 16));
Semantics\Utf8StringsLiteralsTests.cs (42)
230
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(byte[])""hello""").WithArguments("string", "byte[]").WithLocation(7, 21),
233
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(Span<byte>)""dog""").WithArguments("string", "System.Span<byte>").WithLocation(8, 20),
236
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(ReadOnlySpan<byte>)""cat""").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(9, 28)
259
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(byte[])""hello""u8").WithArguments("System.ReadOnlySpan<byte>", "byte[]").WithLocation(7, 21),
262
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(Span<byte>)""dog""u8").WithArguments("System.ReadOnlySpan<byte>", "System.Span<byte>").WithLocation(8, 20)
287
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(byte[])nullConstant").WithArguments("string", "byte[]").WithLocation(8, 21),
290
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(Span<byte>)nullConstant").WithArguments("string", "System.Span<byte>").WithLocation(9, 20),
293
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(ReadOnlySpan<byte>)nullConstant").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(10, 28)
342
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"""hello""").WithArguments("string", "byte[]").WithLocation(6, 54),
345
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"""dog""").WithArguments("string", "byte[]").WithLocation(6, 64)
521
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(byte[])value").WithArguments("string", "byte[]").WithLocation(9, 21),
524
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(Span<byte>)value").WithArguments("string", "System.Span<byte>").WithLocation(10, 20),
527
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(ReadOnlySpan<byte>)value").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(11, 28)
985
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C1)""hello""").WithArguments("string", "C1").WithLocation(8, 17),
988
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C2)""dog""").WithArguments("string", "C2").WithLocation(9, 17),
991
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C3)""cat""").WithArguments("string", "C3").WithLocation(10, 17)
1041
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"""hello""").WithArguments("string", "C1").WithLocation(8, 30),
1044
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"""dog""").WithArguments("string", "C2").WithLocation(8, 40),
1047
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"""cat""").WithArguments("string", "C3").WithLocation(8, 47)
1099
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C1)""hello""").WithArguments("string", "C1").WithLocation(8, 17),
1102
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C2)""dog""").WithArguments("string", "C2").WithLocation(9, 17),
1105
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C3)""cat""").WithArguments("string", "C3").WithLocation(10, 17)
1155
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"""hello""").WithArguments("string", "C1").WithLocation(8, 30),
1158
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"""dog""").WithArguments("string", "C2").WithLocation(8, 40),
1161
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"""cat""").WithArguments("string", "C3").WithLocation(8, 47)
1370
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C1)""hello""").WithArguments("string", "C1").WithLocation(8, 40),
1373
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C2)""dog""").WithArguments("string", "C2").WithLocation(9, 40),
1376
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C3)""cat""").WithArguments("string", "C3").WithLocation(10, 40)
2279
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C2)""dog""u8").WithArguments("System.ReadOnlySpan<byte>", "C2").WithLocation(7, 17),
2282
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C3)""cat""u8").WithArguments("System.ReadOnlySpan<byte>", "C3").WithLocation(8, 17)
2402
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C2)""dog""u8").WithArguments("System.ReadOnlySpan<byte>", "C2").WithLocation(7, 17),
2405
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(C3)""cat""u8").WithArguments("System.ReadOnlySpan<byte>", "C3").WithLocation(8, 17)
2610
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(byte[])""05""u8").WithArguments("System.ReadOnlySpan<byte>", "byte[]").WithLocation(11, 32),
2613
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(Span<byte>)""06""u8").WithArguments("System.ReadOnlySpan<byte>", "System.Span<byte>").WithLocation(12, 36),
2694
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(byte[])""3""U8").WithArguments("System.ReadOnlySpan<byte>", "byte[]").WithLocation(22, 11)
2742
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(Span<byte>)""3""U8").WithArguments("System.ReadOnlySpan<byte>", "System.Span<byte>").WithLocation(22, 11)
2823
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(byte[])s").WithArguments("string", "byte[]").WithLocation(10, 13),
2826
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(Span<byte>)s").WithArguments("string", "System.Span<byte>").WithLocation(11, 13),
2829
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(ReadOnlySpan<byte>)s").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(12, 13)
2865
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(byte[])$""4{s}""").WithArguments("string", "byte[]").WithLocation(10, 13),
2868
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(Span<byte>)$""5{s}""").WithArguments("string", "System.Span<byte>").WithLocation(11, 13),
2871
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, @"(ReadOnlySpan<byte>)$""6{s}""").WithArguments("string", "System.ReadOnlySpan<byte>").WithLocation(12, 13)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (23)
Symbols\CheckedUserDefinedOperatorsTests.cs (2)
5630
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(long)x").WithArguments("C0", "long").WithLocation(20, 28),
5639
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int)x").WithArguments("C0", "int").WithLocation(35, 28)
Symbols\DefaultInterfaceImplementationTests.cs (2)
46991
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int)x").WithArguments("I1", "int").WithLocation(16, 13),
46994
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(byte)x").WithArguments("I1", "byte").WithLocation(17, 17),
Symbols\GenericConstraintConversionTests.cs (9)
693
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(T)b1t").WithArguments("B1<T>", "T").WithLocation(14, 13),
695
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(T)b2").WithArguments("B2", "T").WithLocation(16, 13),
697
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(U)b1o").WithArguments("B1<object>", "U").WithLocation(21, 13),
699
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(U)b2").WithArguments("B2", "U").WithLocation(22, 13));
793
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(V)w").WithArguments("W", "V"),
822
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(U)t").WithArguments("int", "U").WithLocation(10, 13),
826
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int)u").WithArguments("U", "int").WithLocation(12, 13));
1007
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(C0)t").WithArguments("T", "C0").WithLocation(17, 48),
1009
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(T)c").WithArguments("C4<T>", "T").WithLocation(21, 38));
Symbols\GenericConstraintTests.cs (6)
5064
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(int[])x").WithArguments("object[]", "int[]").WithLocation(5, 16),
5066
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(U[])x").WithArguments("T[]", "U[]").WithLocation(13, 16),
5068
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(U[])x").WithArguments("T[]", "U[]").WithLocation(17, 16),
5070
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(object[])x").WithArguments("int[]", "object[]").WithLocation(24, 16),
5072
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(T[])x").WithArguments("U[]", "T[]").WithLocation(32, 16),
5074
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(T[])x").WithArguments("U[]", "T[]").WithLocation(36, 16));
Symbols\StaticAbstractMembersInInterfacesTests.cs (3)
30014
var error = (op == "explicit" ? ErrorCode.
ERR_NoExplicitConv
: ErrorCode.ERR_NoImplicitConv);
31015
var error = (op == "explicit" ? ErrorCode.
ERR_NoExplicitConv
: ErrorCode.ERR_NoImplicitConv);
31066
var error = (op == "explicit" ? ErrorCode.
ERR_NoExplicitConv
: ErrorCode.ERR_NoImplicitConv);
Symbols\SymbolDistinguisherTests.cs (1)
425
Diagnostic(ErrorCode.
ERR_NoExplicitConv
, "(S)Lib.M()").WithArguments("S [Metadata, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]", "S [file.cs(2)]").WithLocation(8, 17));