[fpc-devel] Bug in trunk?
Michael Van Canneyt
michael at freepascal.org
Fri Mar 28 11:48:51 CET 2008
On Fri, 28 Mar 2008, Jonas Maebe wrote:
>
> On 28 Mar 2008, at 07:47, Martin Schreiber wrote:
>
> >What is wrong with this code:
> >"
> >program rangeerror;
> >{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
> >{$ifdef mswindows}{$apptype console}{$endif}
> >uses
> >{$ifdef FPC}{$ifdef linux}cthreads,{$endif}{$endif}
> >sysutils;
> >type
> >colorty = type longword;
> >const
> >cl_mapped = colorty($90000000);
> >type
> >ttestclass = class
> > private
> > fcolor: colorty;
> > published
> > property color: colorty read fcolor write fcolor default cl_mapped; //<<--
> >end;
> >begin
> >end.
>
> It compiles again. Unrelated (because I think such declarations are broken for
> fpu types/values): what code do you have to write so that this default value
> is actually used?
It is used in streaming in the classes unit; the streaming mechanism checks the actual
value against this value: if it is the same, the value is not streamed.
Martin by himself probably doesn't have specific code.
Michael.
More information about the fpc-devel
mailing list