[fpc-devel] Issue 20124: Error with static "direct field" properties

Alexander Klenin klenin at gmail.com
Thu Sep 1 18:42:42 CEST 2011


On Fri, Sep 2, 2011 at 03:01, Florian Klaempfl <florian at freepascal.org> wrote:
> Am 01.09.2011 17:48, schrieb Alexander Klenin:
>> First, I do not see a reason why normal property can not be
>> implemented by static field.
>> Second, even is such a reason is provided, compiler should error out
>> instead of generating bogus code
>> (Optimal solution would be to issue a warning or hint and generate
>> correct code).
>> Either way, "no change required" is IMHO wrong resolution.
>
> Maybe you should reread Jonas' comment? Apparently something in trunk
> has been changed regarding this already.

Jonas' comment is:
>static/class fields can only be read by class properties. Those are not yet supported by FPC 2.4.4, but they are in svn trunk.

I did not deduct from this that the error is now issued instead of wrong code.
Testing indicates that it is indeed the case (the error message could
be somewhat more descriptive,
but no big deal), so sorry for that.
This leaves the first point, however. Why is it prohibited at all?


-- 
Alexander S. Klenin



More information about the fpc-devel mailing list