alias: Revealing Hidden Names of Superclasses
Explore how name hiding occurs in D programming when subclass functions or variables share names with superclasses. Learn to use alias to access or rename these hidden members, ensuring clear interaction between subclasses and superclasses.
We'll cover the following...
We'll cover the following...
Revealing hidden names of superclasses
When the same function name appears both in the superclass and in the subclass, the matching names that are in the superclass are hidden. Even a single name in the subclass is sufficient to hide all of the names of the superclass that match that name:
Since the argument is 42, an int value, one might expect that the Super.foo function that takes an int would be called for that ...