C # Resolution overload method
I have the following methods:
static void OverloadedMethod(Action<ulong> handlerAction)
{
}
static void OverloadedMethod(Action<float> handlerAction)
{
}
static void HandlerA(ulong dataProgress)
{
}
static void HandlerB(float dataProgress)
{
}
I can call
OverloadedMethod(HandlerA);
no problem, but if i try to call
OverloadedMethod(HandlerB);
The compiler complains: Ambiguous call.
I read this article , but I don't understand why the compiler knows which method to choose if the parameter is ulong, but it cannot solve the same situation if the parameter is a float ...
+3
source to share
2 answers