On Mon, Jun 3, 2019 at 4:46 PM Anthony Walter <sys...@gmail.com> wrote:
>
> Is the following a bug in the compiler or a feature? Is would seem using 
> {$mode delphi} allows code which clearly violates range bound to compile 
> without error.
>
> 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.

Debugging option -> check Range (-Cr)

regards,
Marcos Douglas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to