cpplox icon indicating copy to clipboard operation
cpplox copied to clipboard

Support virtual functions invoked from least specific to most specific, with the keyword "inner" being used to invoke the next more specific method

Open Jeff-Mott-OR opened this issue 7 years ago • 0 comments

When you call a method, it starts at the top of the class hierarchy and works down. A superclass method wins over a subclass method. In order to get to the subclass method, the superclass method can call inner, which is sort of like the inverse of super. It chains to the next method down the hierarchy.

The superclass method controls when and where the subclass is allowed to refine its behavior. If the superclass method doesn’t call inner at all, then the subclass has no way of overriding or modifying the superclass’s behavior.

Jeff-Mott-OR avatar May 24 '18 05:05 Jeff-Mott-OR