Ok, so a base class has a method in it. It's not virtual. A derived class needs a slightly different implementation. Can't override because it's not virtual. VB tells one to declare it overloads. Run everything up, in the debugger it's fine. The overload is called.
But, the binding is actually done at compile time. This gives rise to:-
- Deploy the assembly with the derived class. No changes to behaviour. The method in the base class is still called.
- Recompile the client code. Deploy it. No changes other than compilation. The method in the derived class is now called.
I accept this happens, and why it happens (call not callvirt). But surely there are no circumstances in which it can be though of as correct. Why does the compiler allow a method to be overloads/shadows when it is not going to call it until the client is recompiled.
[/rant]
But, the binding is actually done at compile time. This gives rise to:-
- Deploy the assembly with the derived class. No changes to behaviour. The method in the base class is still called.
- Recompile the client code. Deploy it. No changes other than compilation. The method in the derived class is now called.
I accept this happens, and why it happens (call not callvirt). But surely there are no circumstances in which it can be though of as correct. Why does the compiler allow a method to be overloads/shadows when it is not going to call it until the client is recompiled.
[/rant]

Comment