[fpc-devel] C style operator doesn't work with properties in 2.3.1

Joao Morais post at joaomorais.com.br
Thu Jul 17 13:13:39 CEST 2008


Graeme Geldenhuys wrote:
> So is what you mentioned above by design, or an oversight?  In normal
> code like "x := x+y"  you are allowed to use properties or variables.
> So surely the += operator which translates to "x := x+y" should also
> be allowed to use properties.

Except that, when using variables, the first and the second "x" are the 
same entity.

I think what you need is a new feature. If the statement before the += 
token is a property, instead of a variable, the compiler converts it 
into one getter and one setter, and after that use them to perform the 
calculation.

--
Joao Morais



More information about the fpc-devel mailing list