[fpc-devel] streaming readonly properties

Vincent Snijders vsnijders at quicknet.nl
Sun Dec 10 20:54:47 CET 2006


Hi,

I am looking at http://www.freepascal.org/mantis/view.php?id=7638. This 
is a bug which only occurs with fpc 2.1.1, not with fpc 2.0.4.

With fpc 2.1.1 the EditLabel property of a TLabelEdit is not streamed.
It is declared like:
     property EditLabel: TBoundLabel read FEditLabel;

I stepped through the code and found out, that it skips writing the 
property in TWriter.WriteProperty because of the following check:
   if (not Assigned(PPropInfo(PropInfo)^.SetProc)) or
     (not Assigned(PPropInfo(PropInfo)^.GetProc)) then
     exit;

Apparently the SetProc is not assigned.

FPC 2.0.4 has the same code in TWriter.WriteProperty. I conclude that 
the RTTI is different between these two versions.

Questions:
* Are readonly properties like EditLabel streamable or should they 
always have a write specifier?
* Is this a bug in fpc 2.0.4 or in fpc 2.1.1, IOW is the difference 
between fpc 2.0.4 a regression or a bug fix?

Vincent



More information about the fpc-devel mailing list