comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Generic instantiation before actual subprogram body
Date: Thu, 4 Dec 2014 16:49:53 -0600
Date: 2014-12-04T16:49:53-06:00	[thread overview]
Message-ID: <m5qoeh$d2m$1@loke.gir.dk> (raw)
In-Reply-To: wccegsfwh2j.fsf@shell01.TheWorld.com

"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message 
news:wccegsfwh2j.fsf@shell01.TheWorld.com...
> Natasha Kerensikova <lithiumcat@instinctive.eu> writes:
...
> If you avoid anonymous access types, you won't get dynamic accessibility
> checks.  You might get compile-time errors when doing 'Access, but
> that's just an annoyance -- it won't cause bugs.  So yes, I think
> you're being "superstitious".  ;-)

That's not quite true, in that (some?) accessibility checks in generic 
bodies are (formally) dynamic checks. GNAT can (and most likely does, I 
didn't try it) warn on such errors (since it expands bodies), but they're 
still runtime errors (the program can be executed and it would raise 
Program_Error). You don't need any anonymous access types to trigger those 
checks.

The check in question is 3.10.2(29), and the AARM note 3.10.2(29.a/2) 
mentions instance bodies specifically.

Since the OP's question is related to generics, this is potentially 
significant (although I think in practice it won't matter).

                                                  Randy.









      reply	other threads:[~2014-12-04 22:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04  8:48 Generic instantiation before actual subprogram body Natasha Kerensikova
2014-12-04  9:31 ` J-P. Rosen
2014-12-04 10:03   ` Natasha Kerensikova
2014-12-04 10:40     ` Georg Bauhaus
2014-12-04 14:12     ` J-P. Rosen
2014-12-04 15:34     ` Robert A Duff
2014-12-04 15:49 ` Robert A Duff
2014-12-04 22:49   ` Randy Brukardt [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