[fpc-pascal] Release of fpc-2.1.4 aka 2.2.0-beta
Jonas Maebe
jonas.maebe at elis.ugent.be
Sun May 20 16:43:34 CEST 2007
On 20 May 2007, at 16:38, bartek wrote:
> OK. And what about this:
> -----8<-----
> /home/bartek/Dev/units/glgui/glgui.pp(376,33) Error: Can't take the
> address of
> constant expressions
> -----8<-----
> constructor TGLGUI3DMouseMapper.Create(aOwnerDesktop: TGLGUIDesktop);
> begin
> OwnerDesktop:=aOwnerDesktop;
> OwnerDesktop.MouseMapper:=self; // 376 is here
> end;
> -----8<-----
>
> Definition snippet:
> -----8<-----
> // properties
> property OwnerDesktop: TGLGUIDesktop read
> fOwnerDesktop write
> fOwnerDesktop;
> -----8<-----
You cannot write to fields of properties. The reason is that any
property accessor should be transparently replaceable by a function
call, and if you do that in the above expression then your assignment
would change something inside the (temporary) function result rather
than in the field.
Jonas
More information about the fpc-pascal
mailing list