Closed
Description
Description:
Currently when trying to bind methods as a part of TryRunExtensionMethod
(ExtensionMethodToCall
more specifically), we only match the 1st method argument to the most applicable method signature. That means that if we declare the following method:
public static void DoNothing(this Bar bar, double number)
{
}
The following call would bind:
Bar bar = new Bar();
double number = 123;
bar.TryRunExtensionMethod("DoNothing", new object[] { number });
However, if we add the following:
public static void DoNothing(this Bar bar, object obj)
{
}
The call to bar.TryRunExtensionMethod("DoNothing", new object[] { number });
will not bind because there will be two extension methods taking Bar
.
Following the above example, more sensitivity to other method arguments would be welcome, essentially treating them as if they were cast dynamically.