Now that you've modified the code to show;
public static void Foo(this Car car, Bike bike)
{
car.Foo(bike);//Success...
}
All you've done is create an ironic StackOverflowException. This method is now just calling itself recursively, not the implementation of Foo
in Car
.
TIP: Get yourself a copy of ReSharper - it'll put a nice circle-arrow icon on this line of code to show you what's going on without actually needing to compile or run it. :-)