Default, but what default?

When I read Scott Guthrie on default parameters I remembered a test I wrote a little while back:

confused

interface IA
{
    void F(int i = 3);
}

class A : IA
{
    public virtual void F(int i = 4)
    {
        Console.WriteLine("Impl A: "+i);
    }
}

class B : A
{
    public override void F(int i = 5)
    {
        Console.WriteLine("Impl B: " + i);
    }
}

class Program
{
    static void Main(string[] args)
    {
        IA ia = new B();
        ia.F();
        A a = new B();
        a.F();
        B b = new B();
        b.F();
    }
}

What is the output? Do you still like default?

It is easy to understand what is going on when you know that defaults are solved at compile time and the default value is hard coded/copied into the method call. At compile time there is no knowledge of run time types…