Try a similar sample given below:
class Program
{
class P
{}
class Q : P
{}
class A
{
public void Fee(Q q)
{
Console.WriteLine("A::Fee");
}
}
class B : A
{
public void Fee(P p)
{
Console.WriteLine("B::Fee");
}
}
static void Main(string[] args)
{
B b = new B();
/* which Fee is chosen? */
b.Fee(new Q());
Console.ReadKey();
}
}
The compiler seems to prefer linking the "b.Fee()" call to an available method of the type rather than an inherited method (method of a base type) if the parameter can be implicitly cast to match any such method. I.e. implicit casting of the parameter takes precedence over base class method linking.
Though honestly I find the opposite as more intuitive, because for me an inherited method is just as good as a directly introduced method.