Do any OO languages support a mechanism to guarantee an overriden method will call the base?
- by Aaron Anodide
I think this might be a useful language feature and was wondering if any languages already support it.
The idea is if you have:
class C
virtual F
statement1
statement2
and
class D inherits C
override F
statement1
statement2
C.F()
There would be a keyword applied to C.F() such that removing the last line of code above would cause a compiler error because it's saying "This method can be overridden but the implementation here needs to run no matter what".