99 references to ERR_NoConvToIDisp
Microsoft.CodeAnalysis.CSharp (2)
Binder\UsingStatementBinder.cs (1)
261
: (hasAwait ? ErrorCode.ERR_NoConvToIAsyncDisp : ErrorCode.
ERR_NoConvToIDisp
);
Errors\ErrorFacts.cs (1)
1271
case ErrorCode.
ERR_NoConvToIDisp
:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (21)
CodeGen\CodeGenAwaitUsingTests.cs (3)
599
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "new C()").WithArguments("C").WithLocation(6, 16),
602
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var x = new C()").WithArguments("C").WithLocation(9, 16)
2425
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "new C()").WithArguments("C").WithLocation(2, 8)
CodeGen\CodeGenUsingDeclarationTests.cs (1)
820
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using S1 s1 = new S1();").WithArguments("S1").WithLocation(17, 13)
CodeGen\CodeGenUsingStatementTests.cs (17)
1158
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(17, 16)
1240
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15)
1270
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15)
1393
CreateCompilation(source).VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "obj").WithArguments("T"));
1431
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "val").WithArguments("T"),
1434
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "T disp = new T()").WithArguments("T"));
1489
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "res").WithArguments("Program.MyManagedClass").WithLocation(7, 16)
1516
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "res").WithArguments("Program.MyManagedClass").WithLocation(7, 16)
2708
CreateCompilationWithMscorlib40AndSystemCore(source).VerifyDiagnostics(Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "from x in new int[] { 1 } select x").WithArguments("System.Collections.Generic.IEnumerable<int>"));
2735
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "x => x").WithArguments("lambda expression"),
2738
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "() => { }").WithArguments("lambda expression"),
2741
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "(int @int) => { return @int; }").WithArguments("lambda expression"));
2775
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var a = new { }").WithArguments("<empty anonymous type>"),
2778
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var b = new { p1 = 10 }").WithArguments("<anonymous type: int p1>"),
2781
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var c = new { p1 = 10.0, p2 = 'a' }").WithArguments("<anonymous type: double p1, char p2>"),
2784
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "new { }").WithArguments("<empty anonymous type>"),
2787
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, @"new { f1 = ""12345"", f2 = 'S' }").WithArguments("<anonymous type: string f1, char f2>")
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (14)
IOperation\IOperationTests_IUsingStatement.cs (11)
728
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var c1 = new C()").WithArguments("C").WithLocation(9, 26)
777
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "c1").WithArguments("C").WithLocation(10, 26)
1623
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var s = new S()").WithArguments("S").WithLocation(6, 15),
1764
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var s = new S()").WithArguments("S").WithLocation(6, 15),
1905
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var s = new S()").WithArguments("S").WithLocation(6, 15),
2047
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var s = new S()").WithArguments("S").WithLocation(6, 15),
2990
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "GetDisposable() ?? input").WithArguments("NotDisposable").WithLocation(6, 16)
3090
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "b ? GetDisposable() : input").WithArguments("MyDisposable").WithLocation(6, 16)
3198
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "b ? GetDisposable<MyDisposable>() : input").WithArguments("MyDisposable").WithLocation(6, 16)
3321
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "GetDisposable() ?? input").WithArguments("MyDisposable?").WithLocation(6, 16)
7296
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 (58)
Semantics\DelegateTypeTests.cs (3)
7604
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using var d1 = Main;").WithArguments("System.Action").WithLocation(5, 9),
7607
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using var d2 = () => { };").WithArguments("System.Action").WithLocation(6, 9),
7610
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using var d3 = delegate () { };").WithArguments("System.Action").WithLocation(7, 9));
Semantics\OutVarTests.cs (5)
34289
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "int[TakeOutParam(true, out var x1),x1] d = null").WithArguments("int[*,*]").WithLocation(12, 16),
34304
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "int[TakeOutParam(true, out var x2),x2] d = null").WithArguments("int[*,*]").WithLocation(20, 16),
34319
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "int[TakeOutParam(true, out var x3),x3] d = null").WithArguments("int[*,*]").WithLocation(29, 16),
34398
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using int[TakeOutParam(true, out var x1), x1] d = null;").WithArguments("int[*,*]").WithLocation(12, 9),
34413
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "using int[TakeOutParam(true, out var x2), x2] d = null;").WithArguments("int[*,*]").WithLocation(21, 9),
Semantics\RefEscapingTests.cs (1)
96
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var x = GetRefStruct()").WithArguments("C.S2").WithLocation(6, 16));
Semantics\SemanticErrorTests.cs (2)
16231
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "int a = 0").WithArguments("int"),
16233
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "a").WithArguments("int"));
Semantics\StackAllocInitializerTests.cs (3)
1522
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var v1 = stackalloc int [3] { 1, 2, 3 }").WithArguments("System.Span<int>").WithLocation(6, 16),
1525
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var v2 = stackalloc int [ ] { 1, 2, 3 }").WithArguments("System.Span<int>").WithLocation(7, 16),
1528
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)
173
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(12, 16)
207
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(12, 16),
213
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(16, 16)
272
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(12, 16),
278
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(16, 16)
340
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 16),
343
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(19, 16)
375
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(16, 16),
378
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(20, 16)
406
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(11, 16)
446
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(20, 16)
571
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(37, 20),
574
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(50, 20),
577
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(63, 20),
583
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(77, 20),
586
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(92, 24),
589
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(105, 28)
633
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(22, 16),
636
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(26, 16),
639
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S2 s = new S2()").WithArguments("S2").WithLocation(28, 16),
642
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s2b").WithArguments("S2").WithLocation(32, 16)
683
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(21, 15)
714
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15),
717
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(19, 15)
753
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(19, 15)
783
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(16, 15)
814
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15),
817
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "s1b").WithArguments("S1").WithLocation(19, 15)
846
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15)
876
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(15, 15),
955
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 c = new S1()").WithArguments("S1").WithLocation(11, 16),
961
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "c1b").WithArguments("S1").WithLocation(15, 16)
991
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 c = new S1()").WithArguments("S1").WithLocation(11, 16),
997
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "c1b").WithArguments("S1").WithLocation(15, 16)
1049
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 c1 = new S1()").WithArguments("S1").WithLocation(11, 16)
1077
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 c = new S1()").WithArguments("S1").WithLocation(11, 16)
1103
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "C1 c1 = new C1()").WithArguments("C1").WithLocation(11, 16)
1191
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(11, 16)
1200
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "S1 s = new S1()").WithArguments("S1").WithLocation(11, 16)
1221
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "x => x").WithArguments("lambda expression"));
1700
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)
1198
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var d = new ConvertibleToIDisposable()").WithArguments("ConvertibleToIDisposable"));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\ParserErrorMessageTests.cs (1)
4923
Diagnostic(ErrorCode.
ERR_NoConvToIDisp
, "var v = stackalloc int[1]").WithArguments("System.Span<int>").WithLocation(6, 16));