On Wednesday, 5 June 2013 at 22:53:36 UTC, Paulo Pinto wrote:
Here it is described the C# semantics for  virtual methods

http://msdn.microsoft.com/en-us/library/6fawty39.aspx

Ah thanks, I've done very little C# so this is all pretty new to me.

This seems ok too, and actually now that I think about it, the override already takes care of my biggest concern, that we'd accidentally hide something. Given:

class A { void foo(); }
class B:A { override void foo(); }
class C:B { override void foo(); }

The error can pretty easily be "B.foo overrides non-virtual function A.foo" as well as "C.foo overrides non-virtual function A.foo" - the warning on C doesn't need to mention B, since it is already marked override. Thus newbies like me won't incorrectly put virtual on B and accidentally hide A.

So this deprecation will easily point us to put virtual in all the right places and none of the wrong places.


I like it.

Reply via email to