[fpc-devel] property writer can not use baseclass

Martin fpc at mfriebe.de
Sun Oct 17 01:55:06 CEST 2010


  On 17/10/2010 00:33, Alexander Klenin wrote:
> On Sun, Oct 17, 2010 at 05:44, Martin<lazarus at mfriebe.de>  wrote:
>> class TBase
>>   FBar: TObject;
>> end;
>>
>> class TChild(TBase)
>>   function GetBar: TChildObject; // does just a typecast
>>
>>   // provide a property Bar to avoid type-casts
>>   property Bar: TChildObject
>>     read GetBar
>>     write FBar; // this doesn't work
>> end;
> Delphi compatibility?

Its mode objfpc...

It's not a big thing.

It's only about how many extra getter methods you'll end up having in 
the declaration. And therefore how much extra code one has to read.

Of course on the day you write it => no issue, you know it's a forwarder 
with no function, you fold it away...
But one day in the future, when you revisit the code..., you will not 
remember.



More information about the fpc-devel mailing list