Ambiguous call on an Action<T> where T inherits 2 interfaces having the same method signature
问题 I have the following code: public class MyClass { public void MyMethod() { Action<Child> aFoo = a => a.Foo(); } } interface Parent1 { void Foo(); } interface Parent2 { void Foo(); } interface Child : Parent1, Parent2 { } However, the compiler tells me that I have an ambiguous call on aFoo . I tried to do Action<Child> aFoo = (A a) => a.Foo(); but it tells me that I cannot convert lambda expression to delegate type System.Action<Child> How do I resolve the error of ambiguity? 回答1: By casting