comp.lang.ada
 help / color / mirror / Atom feed
From: reinert <reinkor@gmail.com>
Subject: Re: Did I find a bug here?
Date: Fri, 2 Apr 2021 22:46:02 -0700 (PDT)	[thread overview]
Message-ID: <2bb293da-8c8d-471c-ab0a-93fbc0033485n@googlegroups.com> (raw)
In-Reply-To: <ico369FihqfU1@mid.individual.net>

.....snip...
> values. However, note that the compiler may choose to raise 
> Constraint_Error even if there is an "others" alternative; RM 5.4 
> (10.d). To avoid that uncertainty, the program can perform an explicit 
> 'Valid check before the case statement.

Could AB_Type(X) in "case AB_Type(X) is" function as such a valid check?

I try as much as possible to avoid "others" to make the compiler point 
out or to remind  (in my large programs) where to add (or check for) possible 
alternatives in case I extend  the value range of a variable. Then it may happen 
I need to put in for example something like "when A | B | C => null;" instead of "others".

reinert


  reply	other threads:[~2021-04-03  5:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02  6:30 Did I find a bug here? reinert
2021-04-02  7:30 ` J-P. Rosen
2021-04-02  8:33   ` Niklas Holsti
2021-04-03  5:46     ` reinert [this message]
2021-04-03  6:41       ` J-P. Rosen
2021-04-03  8:18         ` Niklas Holsti
2021-04-03 12:37           ` J-P. Rosen
  -- strict thread matches above, loose matches on Subject: below --
2021-04-02  6:15 reinert
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox