117 references to ERR_NoConvToIDisp
Microsoft.CodeAnalysis.CSharp (2)
Binder\UsingStatementBinder.cs (1)
261
: (hasAwait ? ErrorCode.ERR_NoConvToIAsyncDisp : ErrorCode.
ERR_NoConvToIDisp
);
Errors\ErrorFacts.cs (1)
1332
or ErrorCode.
ERR_NoConvToIDisp
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (33)
CodeGen\CodeGenAwaitUsingTests.cs (3)
675
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "new C()").WithArguments("C").WithLocation(6, 16),
678
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var x = new C()").WithArguments("C").WithLocation(9, 16)
3080
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "new C()").WithArguments("C").WithLocation(2, 8)
CodeGen\CodeGenUsingDeclarationTests.cs (12)
820
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using S1 s1 = new S1();").WithArguments("S1").WithLocation(17, 13)
1450
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using const var obj = new object();").WithArguments("object").WithLocation(5, 9),
1462
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using const var obj = new object();").WithArguments("object").WithLocation(1, 1),
1672
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using readonly var obj = new object();").WithArguments("object").WithLocation(5, 9),
1684
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using readonly var obj = new object();").WithArguments("object").WithLocation(1, 1),
1730
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using static var obj = new object();").WithArguments("object").WithLocation(5, 9),
1742
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using static var obj = new object();").WithArguments("object").WithLocation(1, 1),
1788
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using volatile var obj = new object();").WithArguments("object").WithLocation(5, 9),
1800
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using volatile var obj = new object();").WithArguments("object").WithLocation(1, 1),
1878
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using ref object y = ref x;").WithArguments("object").WithLocation(6, 9),
1891
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using ref object y = ref x;").WithArguments("object").WithLocation(2, 1),
1907
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "ref object y = ref x").WithArguments("object").WithLocation(2, 8));
CodeGen\CodeGenUsingStatementTests.cs (18)
1159
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(17, 16)
1241
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15)
1271
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15)
1394
CreateCompilation(source).VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "obj").WithArguments("T"));
1432
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "val").WithArguments("T"),
1435
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "T disp = new T()").WithArguments("T"));
1490
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "res").WithArguments("Program.MyManagedClass").WithLocation(7, 16)
1517
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "res").WithArguments("Program.MyManagedClass").WithLocation(7, 16)
2709
CreateCompilationWithMscorlib40AndSystemCore(source).VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "from x in new int[] { 1 } select x").WithArguments("System.Collections.Generic.IEnumerable<int>"));
2736
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "x => x").WithArguments("lambda expression"),
2739
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "() => { }").WithArguments("lambda expression"),
2742
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "(int @int) => { return @int; }").WithArguments("lambda expression"));
2776
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var a = new { }").WithArguments("<empty anonymous type>"),
2779
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var b = new { p1 = 10 }").WithArguments("<anonymous type: int p1>"),
2782
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var c = new { p1 = 10.0, p2 = 'a' }").WithArguments("<anonymous type: double p1, char p2>"),
2785
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "new { }").WithArguments("<empty anonymous type>"),
2788
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, @"new { f1 = ""12345"", f2 = 'S' }").WithArguments("<anonymous type: string f1, char f2>")
3119
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var s = new S()").WithArguments("S").WithLocation(2, 8),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (11)
RefStructInterfacesTests.cs (2)
7239
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "t").WithArguments("T").WithLocation(23, 16),
7242
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s").WithArguments("IMyDisposable").WithLocation(27, 16)
Semantics\ExtensionTests.cs (4)
22015
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using var x1 = new S1();").WithArguments("S1").WithLocation(1, 1),
22018
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using var x2 = new S2();").WithArguments("S2").WithLocation(2, 1)
22042
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using var x1 = new S1();").WithArguments("S1").WithLocation(1, 1));
22056
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using var x1 = new S1();").WithArguments("S1").WithLocation(1, 1));
Semantics\OutVarTests.cs (5)
34348
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "int[TakeOutParam(true, out var x1),x1] d = null").WithArguments("int[*,*]").WithLocation(12, 16),
34363
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "int[TakeOutParam(true, out var x2),x2] d = null").WithArguments("int[*,*]").WithLocation(20, 16),
34378
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "int[TakeOutParam(true, out var x3),x3] d = null").WithArguments("int[*,*]").WithLocation(29, 16),
34457
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using int[TakeOutParam(true, out var x1), x1] d = null;").WithArguments("int[*,*]").WithLocation(12, 9),
34472
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using int[TakeOutParam(true, out var x2), x2] d = null;").WithArguments("int[*,*]").WithLocation(21, 9),
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (14)
IOperation\IOperationTests_IUsingStatement.cs (11)
1052
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var c1 = new C()").WithArguments("C").WithLocation(9, 26)
1101
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "c1").WithArguments("C").WithLocation(10, 26)
1944
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var s = new S()").WithArguments("S").WithLocation(6, 15),
2078
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var s = new S()").WithArguments("S").WithLocation(6, 15),
2212
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var s = new S()").WithArguments("S").WithLocation(6, 15),
2347
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var s = new S()").WithArguments("S").WithLocation(6, 15),
3277
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "GetDisposable() ?? input").WithArguments("NotDisposable").WithLocation(6, 16)
3373
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "b ? GetDisposable() : input").WithArguments("MyDisposable").WithLocation(6, 16)
3477
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "b ? GetDisposable<MyDisposable>() : input").WithArguments("MyDisposable").WithLocation(6, 16)
3599
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "GetDisposable() ?? input").WithArguments("MyDisposable?").WithLocation(6, 16)
7563
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using var x = new P();").WithArguments("P").WithLocation(8, 13)
IOperation\IOperationTests_IVariableDeclaration.cs (3)
2339
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "int[y switch { int z => 42 }] x = new int[0]").WithArguments("int[]").WithLocation(7, 25),
2400
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "int[y switch { int z => 42 }] x = new int[0]").WithArguments("int[]").WithLocation(7, 25),
2459
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using /*<bind>*/int[y switch { int z => 42 }] x = new int[0]/*</bind>*/;").WithArguments("int[]").WithLocation(7, 8),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (53)
Semantics\DelegateTypeTests.cs (3)
10417
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using var d1 = Main;").WithArguments("System.Action").WithLocation(5, 9),
10420
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using var d2 = () => { };").WithArguments("System.Action").WithLocation(6, 9),
10423
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using var d3 = delegate () { };").WithArguments("System.Action").WithLocation(7, 9));
Semantics\RefEscapingTests.cs (1)
96
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var x = GetRefStruct()").WithArguments("C.S2").WithLocation(6, 16));
Semantics\SemanticErrorTests.cs (2)
16357
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "int a = 0").WithArguments("int"),
16359
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "a").WithArguments("int"));
Semantics\StackAllocInitializerTests.cs (3)
1538
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var v1 = stackalloc int [3] { 1, 2, 3 }").WithArguments("System.Span<int>").WithLocation(6, 16),
1541
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var v2 = stackalloc int [ ] { 1, 2, 3 }").WithArguments("System.Span<int>").WithLocation(7, 16),
1544
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var v3 = stackalloc [ ] { 1, 2, 3 }").WithArguments("System.Span<int>").WithLocation(8, 16)
Semantics\StackAllocSpanExpressionsTests.cs (1)
435
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var v = stackalloc int[1]").WithArguments("System.Span<int>").WithLocation(6, 16)
Semantics\UsingStatementTests.cs (43)
96
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "Main").WithArguments("method group"));
141
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "C1 c1 = new C1()").WithArguments("C1").WithLocation(11, 16)
170
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(12, 16)
201
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(12, 16),
204
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(16, 16)
260
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(12, 16),
263
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(16, 16)
325
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 16),
328
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(19, 16)
360
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(16, 16),
363
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(20, 16)
388
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(11, 16)
425
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(20, 16)
550
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(37, 20),
553
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(50, 20),
556
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(63, 20),
559
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(77, 20),
562
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(92, 24),
565
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(105, 28)
609
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(22, 16),
612
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(26, 16),
615
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S2 s = new S2()").WithArguments("S2").WithLocation(28, 16),
618
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s2b").WithArguments("S2").WithLocation(32, 16)
656
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(21, 15)
687
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15),
690
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(19, 15)
723
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(19, 15)
753
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(16, 15)
784
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15),
787
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(19, 15)
816
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15)
846
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15)
919
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 c = new S1()").WithArguments("S1").WithLocation(11, 16),
922
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "c1b").WithArguments("S1").WithLocation(15, 16)
949
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 c = new S1()").WithArguments("S1").WithLocation(11, 16),
952
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "c1b").WithArguments("S1").WithLocation(15, 16)
1001
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 c1 = new S1()").WithArguments("S1").WithLocation(11, 16)
1026
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 c = new S1()").WithArguments("S1").WithLocation(11, 16)
1052
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "C1 c1 = new C1()").WithArguments("C1").WithLocation(11, 16)
1195
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(11, 16)
1201
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(11, 16)
1222
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "x => x").WithArguments("lambda expression"));
1701
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "t0").WithArguments("T0").WithLocation(16, 16));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Symbols\AnonymousTypesSemanticsTests.cs (2)
1333
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var v1 = new { }").WithArguments("<empty anonymous type>")
1370
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var v1 = new { }").WithArguments("<empty anonymous type>").WithLocation(6, 26)
Symbols\ConversionTests.cs (1)
1541
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var d = new ConvertibleToIDisposable()").WithArguments("ConvertibleToIDisposable"));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\ParserErrorMessageTests.cs (1)
4762
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var v = stackalloc int[1]").WithArguments("System.Span<int>").WithLocation(6, 16));