Skip to content

Wrong allowed range reported in errormessage for QWord property "default" value.

program test;
{$mode objfpc}
{$h+}

type
  TA = class
  private
    FNumber: QWord;
  public
    //Error: range check error while evaluating constants (4294967296 must be between -2147483648 and 4294967295)
    property Number: QWord read FNumber write FNumber default QWord(High(DWord))+1;
  end;

begin
end.

Since Number is a QWord fpc should not expect the value to be negative at all.
So, it should (if values > High(DWord) are illegal) report:
"Error: range check error while evaluating constants (4294967296 must be between 0 and 4294967295)"

Fpc 3.3.1-2495-g6453af40 32-bit (and crosscompile 64-bit) on Win64.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information