comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: GNAT bug with assertions
Date: Mon, 13 Aug 2018 19:37:35 -0700 (PDT)
Date: 2018-08-13T19:37:35-07:00	[thread overview]
Message-ID: <5d0d77b9-d9ff-4d4d-8f9c-c6fab693b248@googlegroups.com> (raw)
In-Reply-To: <lytvnymfd9.fsf@pushface.org>

Am Montag, 13. August 2018 17:54:28 UTC+2 schrieb Simon Wright:
>    function Maybe (X : Priv) return Subt is
>    begin
>       return X;
>    end Maybe;
> 
> called as
> 
>    S : Subt := Maybe (-1);
>    
> Maybe happily returns -1 and leaves it up to the assignment to raise the
> necessary exception.
> 
> And if the assignment is
> 
>    P : Priv := Maybe (-1);
> 
> no exception is raised.

Yes, this is what currently happens. Assertion_Error should instead be raised in both cases by Maybe.

      parent reply	other threads:[~2018-08-14  2:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-10 10:29 GNAT bug with assertions AdaMagica
2018-08-10 14:23 ` Anh Vo
2018-08-10 15:16 ` Jacob Sparre Andersen
2018-08-10 16:16   ` Simon Wright
2018-08-10 20:42     ` Randy Brukardt
2018-08-12 18:35       ` AdaMagica
2018-08-12 18:51         ` Simon Wright
2018-08-13  9:03           ` AdaMagica
2018-08-13  9:07             ` Simon Wright
2018-08-13 15:54               ` Simon Wright
2018-08-13 16:55                 ` Simon Wright
2018-08-14  2:37                 ` AdaMagica [this message]
replies disabled

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