Why do I get ambiguous call error between (Func<IInterface>)
and (Func<Task<IInterface>>)
for the next code sample? And how can I avoid this error without replacing method group call?
public class Program
{
public static void Main(string[] args)
{
Method(GetObject);
}
public static IInterface GetObject() => null;
public static void Method(Func<IInterface> func) =>
Console.WriteLine("First");
public static void Method(Func<Task<IInterface>> funcAsync) =>
Console.WriteLine("Second");
}
public interface IInterface { }