Overloads and shadow by signature
Posted
Sunday, July 25, 2004 4:31 PM
by
bill
In VB.NET the Overloads keyword is overloaded itself, having two different meanings. One is adding a new method with the same name but different signature, and the other is shadowing a base class method with a method of the same name and signature (Hide-by-sig)
The problem is the developer can’t tell the difference unless they look closely at the base class, and its base class, all the way down to System.Object
I would like to see the VB team include a new keyword for hide by signature, such as ShadowBySig, and introduce a compiler warning if Overloads is used as hide by sig. This would allow us to remove this ambiguity over time without breaking any code, and in the long term makes code more readable, easier to understand, and less prone to accidental hiding by signature.
Thoughts ?