It allows the natural type of a method group to contribute to method type inference, so scenarios like the following can work:
Test(IsEven); // Error CS0411 The type arguments for method 'Program.Test<T>(Func<T, bool>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
partial class Program
{
public static bool IsEven(int x) => x % 2 == 0;
public static void Test<T>(Func<T, bool> predicate) { }
}
Type inference using method group natural type
Summary
It allows the natural type of a method group to contribute to method type inference, so scenarios like the following can work:
Design meetings