« Reply #6 on: September 14, 2021, 02:20:54 pm »
Why not write as a class helper? (instead of inheritance)
Because you can't override virtual methods this way.
https://wiki.freepascal.org/Helper_types#Method_hidingRestrictions
A helper type may not
contain (class) destructors (except in trunk FPC 3.3.1)
contain class constructors (except in trunk FPC 3.3.1)
contain fields
contain abstract methods
"override" virtual methods of the extended class (they can be hidden by the helper though)
Methods of the extended type can be overloaded (thus they are not hidden by the helper) by using the overload keyword.
A call to Inherited MethodName should still work, or not?No, it doesn't, but the question remains: Does he even need to call the "Ancestor"-Method?
« Last Edit: September 14, 2021, 02:25:33 pm by Zvoni »
Logged
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad