Why doesn’t the commented-out line compile? It seems like the compiler should be able to infer the method signature without any ambiguity.
public class Program {
static string A(int x) => $"a{x}";
static string B(int x) => $"b{x}";
public static void Main() {
var a = A;
var b = B;
// Console.WriteLine((true ? A : B)(34)); // this does not work
Console.WriteLine((true ? a : b)(34)); // this does
}
}