[fpc-devel] FPC 2.3.1 SVN 8427: new compilation error.

Michael Schnell mschnell at lumino.de
Wed Sep 12 11:20:16 CEST 2007


there should not be a temp as the object referenced needs to be modified 
using it's "set" method "on the fly" i.e. a second reference to that 
object within the called procedure needs to reflect the changes made in 
the instruction just executed. Everything else would be very ambiguous.

-Michael

example

type
  Tx = class,,
    fz: integer;
    ..
    procedure sety(value: integer);
    ...
    property y: integer write sety
    property z: integer read fz write fz
  end;



var
  x: tx

function  sub (var i: integer): integer;
begin
  i := 4;
  Result := x.z;
end;



procedure Tx. sety(value: integer);
begin
  fz := value;
end;



procedure main;
begin
  x := Tx.create;
  test := sub(x.y);
end;



More information about the fpc-devel mailing list