mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 08:49:33 +02:00

Delphi mode (mantis #35671) * always give an error (rather than only a warning in case range checking is disabled) when assigning an out-of-range constant to an ordinal variable whose type does not span the entire range that its bits can hold (because the result is undefined and FPC's optimisers rely on variables only holding values that are valid for the type) git-svn-id: trunk@42272 -
16 lines
249 B
ObjectPascal
16 lines
249 B
ObjectPascal
{ %fail }
|
|
program Project1;
|
|
|
|
{$mode delphi}
|
|
|
|
type
|
|
TSuit = (suHeart, suDiamond, suClub, suSpade);
|
|
TRedSuit = suHeart..suDiamond;
|
|
|
|
var
|
|
Suit: TRedSuit;
|
|
begin
|
|
// This should generate an error, but {$mode delphi} allows it
|
|
Suit := suClub;
|
|
end.
|