readonly properties are writeable by "with"
Original Reporter info from Mantis: Ocye
-
Reporter name: Heiko Tietze
Description:
program Project1;
{$mode objfpc}{$H+}
uses
cthreads,
Classes;
type TTest=record
x,y : byte;
end;
TTestClass=class
private
FTest : TTest;
public
property Test:TTest read FTest;
end;
var tc:TTestClass;
begin
tc:=TTestClass.Create;
tc.FTest.x:=99;
try
//tc.Test.x:=11; -> project1.lpr(26,12) Error: Argument can't be assigned to
with tc.Test do x:=11;
writeln(tc.Test.x); //11
finally
tc.Free;
end;
end.
Mantis conversion info:
-
Mantis ID: 14534
-
Monitored by: » Ocye (Heiko Tietze), » crossbuilder (Burkhard Carstens), » Paradice (Paradice)