View Issue Details

IDProjectCategoryView StatusLast Update
0019199FPCCompilerpublic2011-04-20 10:31
ReporterEko Wahyudin Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Product Version2.4.2 
Summary0019199: fpc unable to compile a class with default property value over than 32 bits
Descriptionfpc produce error message
  "range check error while evaluating constants"
while compiling a class, and in that class contain a property with default value over than 32 bits.
Steps To Reproducejust compile this class

  TMyType = UInt64;

  TMyClass = Class
    FMyProperty: UInt64;
    constructor Create;
    property MyProperty: TMyType
      read FMyProperty
      write FMyProperty
      default $FFFFFFFFFFFF; // <----error point here
                             // "range check error while evaluating constants"
Tags64bit, RTTI
Fixed in Revision
Attached Files


2011-04-19 15:31


unit2.pas (469 bytes)

Jonas Maebe

2011-04-19 15:44

manager   ~0047607

Last edited: 2011-04-19 16:48

That's mandated by the Delphi-compatible RTTI format, which only has room for a 32 bit default value, see e.g.

I don't know whether this has/will be changed in Delphi 64 bit.

Eko Wahyudin

2011-04-20 04:42

reporter   ~0047619

we discuss on lazarus forum,12884.0.html

Alexander S. Klenin

2011-04-20 07:42

reporter   ~0047621

IMO this is a good feature to request, although not implemented in Delphi.
I'd like to have not only Int64,
but also floating point and string default values.

Jonas Maebe

2011-04-20 10:31

manager   ~0047624

The suggestion about doing it differently in Delphi and ObjFPC modes is not possible. There is only one RTTI format, since the RTTI routines in the RTL have no clue about whether the RTTI they are processing comes from FPC or Delphi-compiled code, and the RTTI from units compiled in different modes must be compatible so that you can e.g. inherit from a class defined in a Delphi-mode unit inside an ObjFPC-mode unit.

I don't know whether the RTTI format can be changed in a way that does not break common Delphi programs and still allows more features like this. But I'm not an RTTI person, so I will definitely not be the one working on this.

Issue History

Date Modified Username Field Change
2011-04-19 15:31 Eko Wahyudin New Issue
2011-04-19 15:31 Eko Wahyudin File Added: unit2.pas
2011-04-19 15:35 Eko Wahyudin Tag Attached: 64bit
2011-04-19 15:35 Eko Wahyudin Tag Attached: compiler
2011-04-19 15:44 Jonas Maebe Note Added: 0047607
2011-04-19 16:48 Jonas Maebe Note Edited: 0047607
2011-04-20 04:42 Eko Wahyudin Note Added: 0047619
2011-04-20 07:42 Alexander S. Klenin Note Added: 0047621
2011-04-20 10:31 Jonas Maebe Note Added: 0047624
2011-04-21 11:51 Jonas Maebe Tag Detached: compiler
2011-04-21 11:51 Jonas Maebe Tag Attached: RTTI