In the below the field for the property is in a nested record/object.
run to the "write" line.
pdr) p f
F = TFoo(@$00007F031C8E0060) { x: TRec { a: 11, b: TT { a1: ..., b1: ... } }, n: 0, y: TRec { a: 21, b: TT { a1: ..., b1: ... } }, t: 21 }
However, the correct value is "22".
program project1; {$Mode objfpc}
type
TT = record
a1,b1:word;
end;
TRec = object
a: byte;
b: TT;
end;
TFoo = class
protected
x: TRec;
n: integer;
y: TRec;
public
property t: word read y.b.a1;
end;
var f : TFoo;
begin
f:=TFoo.Create;
f.x.a:=11;
f.x.b.a1:=12;
f.y.a:=21;
f.y.b.a1:=22;
write(f.t);
end.
In the below the field for the property is in a nested record/object.
run to the "write" line.
However, the correct value is "22".