Skip to content

usage of default-intrinsic does not trigger range checks

Original Reporter info from Mantis: kays @KaiBurghardt
  • Reporter name: Kai Burghardt

Description:

When default(ordinalType) is used as the sole factor of an expression in an assignment, no range checks are triggered.

Steps to reproduce:

program rangesWithoutDefault(input, output, stderr);
{$R+}
type
	r = -1..-1;
var
	i: r;
begin
	i := default(r);
	writeLn(i);
end.

Mantis conversion info:

  • Mantis ID: 34972
  • Build: 3.0.4+dfsg-11 [2017/12/30]
  • Version: 3.0.4
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information