From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.karotte.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Generic instantiation before actual subprogram body Date: Thu, 4 Dec 2014 16:49:53 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1417733394 13398 24.196.82.226 (4 Dec 2014 22:49:54 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 4 Dec 2014 22:49:54 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: number.nntp.giganews.com comp.lang.ada:191174 Date: 2014-12-04T16:49:53-06:00 List-Id: "Robert A Duff" wrote in message news:wccegsfwh2j.fsf@shell01.TheWorld.com... > Natasha Kerensikova 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.