Menu ▾ ▴

#693 How to call an overridden base member operator, in disabling polymorphism (inheritance only)?

open
nobody
None
compiler
2023-04-25
2013-07-27
No

Now the bug #663 is fixed, this solves the problem of calling an overridden base member method, from within a derived method.
But the problem is not be solved concerning the overridden member operators.

For example, how to code the cascade of the overriden 'Let/Cast' member operators.
With operators non overridden:

  • the 'Let' operators cascading can use (in Child):
    Cast(Parent, This) = Cast(Parent, rhs)
  • the 'Cast' operators cascading can use (in Child):
    Operator = Cast(Parent, This) + .....
    but not at all if overriding is used (otherwise we get a infinite loop that induces a stack overflow).

How to call a base member operator which is overridden, from within a derived method in disabling the polymorphism (with inheritance only)?
In C++, there is not this problem, because the base operators can be called like functions.

Similar calling syntax proposals (examples for some operators):
"Base [ .Base ... ] .Operator Let(rhs)"
"Base [ .Base ... ] .Operator Cast()"

Discussion


Log in to post a comment.