<p style="padding:0 0 0 0; margin:0 0 0 0;">Done, https://bugs.freepascal.org/view.php?id=32896</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">V.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br />
> Od: Michael Van Canneyt <michael@freepascal.org><br />
> Komu: FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org><br />
> Datum: 28.12.2017 16:43<br />
> Předmět: Re: [fpc-pascal] Publishing indexed property in descendant<br />
></p>
<br />
<br />
On Thu, 28 Dec 2017, Vojtěch Čihák wrote:<br />
<br />
> Hi,<br />
> <br />
> is this bug?<br />
> <br />
> { TCompStreamPers }<br />
> TCompStreamPers = class(TCustomControl)<br />
> private<br />
> function GetItem(AIndex: Integer): TPersItem;<br />
> procedure SetItem(AIndex: Integer; AValue: TPersItem);<br />
> protected<br />
> FItems: TFPObjectList;<br />
> public<br />
> constructor Create(AOwner: TComponent); override;<br />
> destructor Destroy; override;<br />
> //published<br />
> property Item[AIndex: Integer]: TPersItem read GetItem write SetItem;<br />
> end;<br />
> <br />
> TCompStreamPers2 = class(TCompStreamPers)<br />
> published<br />
> property Item;<br />
> end;<br />
> <br />
> If I try to publish property Item in TCompStreamPers, compiler rejects with "compstreampers.pas(31,19) Error: This kind of property cannot be published".<br />
> <br />
> But when I do it in descendant class, compiler is silent. Delphi7 does not allow it: "[Error] Unit2.pas(35): Published property 'Item' cannot be of type ARRAY".<br />
<br />
It is a bug, please post a bug report.<br />
<br />
Michael.<br />
<br />
----------<br />
<br />
_______________________________________________<br />
fpc-pascal maillist - fpc-pascal@lists.freepascal.org<br />
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a>