Problem
Let's say I have the following extension method:
public Func<T2, TResult> Curry<T1, T2, TResult>(this Action<T1, T2, TResult> action, T1 arg) {}
and the following class method:
public static int Add(int x1, int x2);
If I call this extension method as a normal method, it looks like this:
However as an extension method, it would look like this:
((Action<int, int>)Add).Curry(5);
Another related problem is with interpolated strings -- since extension methods do not affect type choice, it is not possible to call IFormattable extension methods on $"".
Potential solution
I suggest allowing extension methods to influence the type choice for the method group.
Example:
Similar logic should apply to $"".
Pros
- Consistency between different call types
- Reduced verbosity in functional scenarios (e.g. Select(Add.Curry(5)))
- Allows extension methods on
FormattableString
Cons
- Resolution is pretty complex as it is, not sure if there are any edge cases that would complicate this further