Please, consider the following code:
static void foo(object v)
{
System.Console.WriteLine(v.GetType());
}
static void foo(OleDbType v)
{
System.Console.WriteLine(v.GetType());
}
static void Main(string[] args)
{
foo(1);
foo(0);
foo(2);
}
The output is:
System.Int32
System.Data.OleDb.OleDbType
System.Int32
So foo(0)
is resolved to static void foo(OleDbType)
and the other calls are resolved to static void foo(object)
I'd expect all the calls to be resolved to the same method, why this happens?