102 references to ERR_MethDelegateMismatch
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Conversions.cs (2)
2974
TypeKind.Delegate => ErrorCode.
ERR_MethDelegateMismatch
,
3094
diagnostics.Add(ErrorCode.
ERR_MethDelegateMismatch
, delegateMismatchLocation, boundMethodGroup.Name, delegateType);
Binder\Binder_Expressions.cs (1)
5478
diagnostics.Add(ErrorCode.
ERR_MethDelegateMismatch
, node.Location,
Binder\Binder_Statements.cs (1)
2494
errorCode = ErrorCode.
ERR_MethDelegateMismatch
;
Errors\ErrorFacts.cs (1)
719
or ErrorCode.
ERR_MethDelegateMismatch
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (34)
Diagnostics\MethodGroupConversion.cs (2)
62
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M3").WithArguments("M3", "D").WithLocation(11, 13),
65
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new D(M3)").WithArguments("M3", "D").WithLocation(12, 13),
FirstClassSpanTests.cs (5)
4919
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "C.M").WithArguments("C.M(System.Span<int>)", "D").WithLocation(3, 5));
5021
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "System.Func<int, int>").WithLocation(4, 12),
5140
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "System.Func<int, int>").WithLocation(4, 12),
5146
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M<int>").WithArguments("M", "System.Func<int, int>").WithLocation(7, 12),
5152
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "System.Func<int, int>").WithLocation(10, 23)
RefReadonlyParameterTests.cs (13)
7223
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "Y").WithArguments("Y", "X").WithLocation(8, 7),
7226
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "X").WithArguments("X", "Y").WithLocation(9, 7)
7270
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "X").WithArguments("X", "Y").WithLocation(9, 7)
7331
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "Y1").WithArguments("Y1", "X").WithLocation(5, 7),
7334
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "Y2").WithArguments("Y2", "X").WithLocation(7, 7));
7397
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "Y").WithArguments("Y", "X").WithLocation(7, 13));
7438
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "(X)C.Y").WithArguments("Y", "X").WithLocation(4, 5));
7489
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new X(C.Y)").WithArguments("Y", "X").WithLocation(4, 5));
7724
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "Y").WithArguments("Y", "X").WithLocation(4, 7),
7733
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "Y").WithArguments("Y", "X").WithLocation(4, 7)
7826
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "Y").WithArguments("Y", "X").WithLocation(4, 7),
7829
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "X").WithArguments("X", "Y").WithLocation(9, 7));
7847
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "X").WithArguments("X", "Y").WithLocation(4, 7)
RefStructInterfacesTests.cs (6)
23451
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "System.Action").WithLocation(6, 14),
23454
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "System.Action").WithLocation(12, 14)
23494
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "System.Action").WithLocation(7, 20),
23497
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "System.Action").WithLocation(15, 20)
23537
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "<anonymous delegate>").WithLocation(7, 20),
23540
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "<anonymous delegate>").WithLocation(15, 20)
Semantics\ExtensionTests.cs (8)
18088
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "D").WithLocation(1, 15),
18363
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "System.Action").WithLocation(1, 26),
18366
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M2").WithArguments("M2", "System.Action").WithLocation(2, 22));
18389
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M2").WithArguments("M2", "System.Action").WithLocation(5, 30));
18471
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "D").WithLocation(1, 14),
18474
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "object.M2").WithArguments("E.extension(object).M2(long)", "D2").WithLocation(2, 9));
18591
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M2").WithArguments("M2", "D2").WithLocation(2, 16),
18597
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M4").WithArguments("M4", "D2").WithLocation(5, 11));
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (10)
IOperation\IOperationTests_IDelegateCreationExpression.cs (9)
604
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M1").WithArguments("M1", "System.Action").WithLocation(7, 30)
635
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M1").WithArguments("M1", "System.Action").WithLocation(7, 30)
827
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "(Action)M1").WithArguments("M1", "System.Action").WithLocation(7, 30)
859
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "(Action)p.M1").WithArguments("M1", "System.Action").WithLocation(8, 30)
1212
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Action(M1)").WithArguments("M1", "System.Action").WithLocation(7, 30)
1541
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "(Action)M1").WithArguments("M1", "System.Action").WithLocation(7, 41)
1643
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Action<int>((Action)M1)").WithArguments("System.Action.Invoke()", "System.Action<int>").WithLocation(7, 35)
1723
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M1").WithArguments("M1", "System.Action<int>").WithLocation(7, 35)
1823
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Action<int>(M1)").WithArguments("M1", "System.Action<int>").WithLocation(7, 35)
IOperation\IOperationTests_IEventAssignmentExpression.cs (1)
277
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "t.MyEvent += Handler").WithArguments("Handler", "System.EventHandler").WithLocation(18, 19),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (36)
Semantics\ColorColorTests.cs (3)
1199
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "System.Action<string>"));
2215
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new System.Action(C2.ReferenceEquals)").WithArguments("ReferenceEquals", "System.Action").WithLocation(9, 13)
2221
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new System.Action(C2.ReferenceEquals)").WithArguments("ReferenceEquals", "System.Action").WithLocation(9, 13)
Semantics\DelegateTypeTests.cs (2)
1494
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "F<int>").WithArguments("F", "System.Action").WithLocation(6, 34)
17016
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "Program.Del").WithLocation(15, 42));
Semantics\NullableReferenceTypesTests.cs (2)
70269
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Action<string?, string>(c.M3)").WithArguments("M3", "System.Action<string?, string>").WithLocation(15, 13),
70272
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Action(c.M3)").WithArguments("M3", "System.Action").WithLocation(16, 13)
Semantics\OverloadResolutionTests.cs (2)
7531
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "goo").WithArguments("goo", "System.EventHandler").WithLocation(9, 14),
11566
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "F").WithArguments("F", "System.Action<System.DateTime>").WithLocation(13, 30)
Semantics\RefFieldTests.cs (4)
16044
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "(D1R)M2").WithArguments("M2", "D1R").WithLocation(16, 18),
16047
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "(D2R)M1").WithArguments("M1", "D2R").WithLocation(17, 18),
16050
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new D1R(M2)").WithArguments("M2", "D1R").WithLocation(21, 18),
16053
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new D2R(M1)").WithArguments("M1", "D2R").WithLocation(22, 18));
Semantics\SemanticErrorTests.cs (17)
107
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "DelegatedMethod2").WithArguments("DelegatedMethod2", "MyDelegate1"),
110
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "DelegatedMethod3").WithArguments("DelegatedMethod3", "MyDelegate1"),
113
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "DelegatedMethod2").WithArguments("DelegatedMethod2", "MyDelegate1"),
116
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "DelegatedMethod3").WithArguments("DelegatedMethod3", "MyDelegate1")
389
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "bar1").WithArguments("bar1", "boo<int>").WithLocation(12, 18),
404
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "bar").WithArguments("bar", "boo<string>").WithLocation(19, 19),
447
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "far<short>").WithArguments("far", "boo<int>")
473
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "far<short>").WithArguments("far", "boo<int>")
3427
new ErrorDescription[] { new ErrorDescription { Code = (int)ErrorCode.
ERR_MethDelegateMismatch
, Line = 11, Column = 15 } });
3449
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "far<int>").WithArguments("C.far<int>(int)", "boo"));
3480
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "C<long>.far").WithArguments("C<long>.far(long)", "boo").WithLocation(15, 24),
3483
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "par<byte>").WithArguments("par", "boo").WithLocation(16, 32),
3536
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "F3").WithArguments("F3", "D<B, B>"),
3538
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "F6").WithArguments("F6", "D<B, B>"),
3540
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "F9").WithArguments("F9", "D<B, B>"));
23077
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new D1(d3)").WithArguments("CSSample.Program.D3.Invoke(int)", "CSSample.Program.D1").WithLocation(29, 18),
23086
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new D1(M2)").WithArguments("M2", "CSSample.Program.D1").WithLocation(32, 18),
Semantics\SpanStackSafetyTests.cs (4)
1905
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "GetHashCode").WithArguments("GetHashCode", "System.Func<int>").WithLocation(10, 48),
1908
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "GetHashCode").WithArguments("GetHashCode", "System.Func<int>").WithLocation(13, 43),
1911
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "GetType").WithArguments("GetType", "System.Func<System.Type>").WithLocation(15, 48),
1914
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "ToString").WithArguments("ToString", "System.Func<string>").WithLocation(17, 46)
Semantics\TargetTypedConditionalOperatorTests.cs (1)
161
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M3").WithArguments("M3", "Del").WithLocation(6, 26)
Semantics\UseSiteErrorTests.cs (1)
2079
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "M").WithArguments("M", "System.Action<string>"),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (17)
BadSymbolReference.cs (2)
639
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "Test2").WithArguments("Test2", "CL3_D1").WithLocation(195, 23),
720
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "Test2").WithArguments("Test2", "CL3_D1").WithLocation(195, 23),
Symbols\ConversionTests.cs (1)
920
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "goo").WithArguments("goo", "System.Action"));
Symbols\Source\DelegateTests.cs (14)
601
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Da(FTT)").WithArguments("FTT", "DelegateTest.Da").WithLocation(44, 14),
610
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Daa(FT)").WithArguments("FT", "DelegateTest.Daa").WithLocation(48, 15),
613
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Daa(FTi)").WithArguments("FTi", "DelegateTest.Daa").WithLocation(49, 15),
616
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Daa(PTT)").WithArguments("PTT", "DelegateTest.Daa").WithLocation(50, 15),
622
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Dai(FT)").WithArguments("FT", "DelegateTest.Dai").WithLocation(53, 15),
628
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Dai(PTT)").WithArguments("PTT", "DelegateTest.Dai").WithLocation(55, 15),
634
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Dab(FT)").WithArguments("FT", "DelegateTest.Dab").WithLocation(58, 15),
640
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Dab(FTi)").WithArguments("FTi", "DelegateTest.Dab").WithLocation(60, 15),
643
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Dab(PTT)").WithArguments("PTT", "DelegateTest.Dab").WithLocation(61, 15),
649
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Dpa(FTT)").WithArguments("FTT", "DelegateTest.Dpa").WithLocation(64, 15),
655
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Dapa(FT)").WithArguments("FT", "DelegateTest.Dapa").WithLocation(67, 16),
661
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Dapb(FT)").WithArguments("FT", "DelegateTest.Dapb").WithLocation(70, 16),
670
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Dpapa(FT)").WithArguments("FT", "DelegateTest.Dpapa").WithLocation(74, 17),
676
Diagnostic(ErrorCode.
ERR_MethDelegateMismatch
, "new Dca(FTT)").WithArguments("FTT", "DelegateTest.Dca").WithLocation(77, 15),