[Lazarus] AutoCommit
Ondrej Pokorny
lazarus at kluug.net
Sat Nov 14 12:24:12 CET 2020
On 14.11.2020 11:26, Michael Van Canneyt wrote:
> On Sat, 14 Nov 2020, Ondrej Pokorny wrote:
>> Then I saw the next chapter "Overriding properties". It wrongly
>> described redeclaring of properties as overriding. I fixed that as
>> well in r1778.
>
> I think the difference is rather artificial, but if you think this is
> better: great.
You are right. I didn't know one can override also read/write specifiers
(I thought one must redeclare the property in that case):
TAncestor = class(TComponent)
private
fPropName: string;
published
property PropName: string read fPropName write fPropName;
end;
TOverride = class(TAncestor)
private
fPropName2: string;
published
property PropName read fPropName2 write fPropName2; // no type
declaration
end;
But anyway as stated in the Delphi docs
http://docwiki.embarcadero.com/RADStudio/Sydney/en/Properties_(Delphi)#Property_Overrides_and_Redeclarations
:
/Whether a property is hidden or overridden in a derived class, property
look-up is always static./
So you are right - there is no real difference in property
override/reintroduce like there is override/overload/reintroduce
difference in object methods.
I'll make that more clear in FPC docs.
Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20201114/1eec7094/attachment.html>
More information about the lazarus
mailing list