Overwriting hidden methods: X# vs VO
Posted: Fri Mar 10, 2023 12:21 pm
The following Code
class MySuperClass
constructor
self:_setup()
hidden method _setup()
Safedebout32("mysuperclass",classname(self))
return
end class
class MySubClass inherit MySuperClass
hidden method _setup()
Safedebout32("mysubclass",classname(self))
return
end class
function TestCode() as usual clipper
local o as MySubClass
o := MySubClass{}
return
arrives at the green Line in VO and at the red line in X#. Do we really need to refactor all these occurences or is there some switch to enable VO-like behaviour in this case?
P.S.: If I omit the HIDDEN statement the behaviour is the same in both languages.
class MySuperClass
constructor
self:_setup()
hidden method _setup()
Safedebout32("mysuperclass",classname(self))
return
end class
class MySubClass inherit MySuperClass
hidden method _setup()
Safedebout32("mysubclass",classname(self))
return
end class
function TestCode() as usual clipper
local o as MySubClass
o := MySubClass{}
return
arrives at the green Line in VO and at the red line in X#. Do we really need to refactor all these occurences or is there some switch to enable VO-like behaviour in this case?
P.S.: If I omit the HIDDEN statement the behaviour is the same in both languages.