From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!aioe.org!Yr2L9qaRshuL+yFKTxsDBA.user.46.165.242.75.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Is this an error in compiler Date: Sun, 11 Sep 2022 09:10:12 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <4eecf346-667a-4dee-80b2-c3597b0f6fa7n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: gioia.aioe.org; logging-data="51179"; posting-host="Yr2L9qaRshuL+yFKTxsDBA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:FxBeagp1Uk3mdWw8v3n04oq9LX0= Xref: reader01.eternal-september.org comp.lang.ada:64315 List-Id: reinert writes: (4 times!!!!) > However, if I uncomment the "a" line and comment out the "b" line (see > code above), then I get the error message: > > c0a.adb:45:04: error: instantiation error at line 27 > c0a.adb:45:04: error: "cfe2" is not visible > c0a.adb:45:04: error: instantiation error at line 27 > c0a.adb:45:04: error: non-visible declaration at line 10 > > Have you the same experience? You have the conditions the wrong way round: if the 'a' line is commented out and the 'b' lines are uncommented, the compilation succeeds; the source as presented (and if compiled with -gnatX) fails in the way you state. And, yes, it's a compiler error. I have to say these conditional constructs strike me as regrettable Perl-isms, and reduce clarity: return foo when blah; raise baz when quux;