comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Is this an error in compiler
Date: Sun, 11 Sep 2022 09:10:12 +0100	[thread overview]
Message-ID: <ly1qsi9vrv.fsf@pushface.org> (raw)
In-Reply-To: 4eecf346-667a-4dee-80b2-c3597b0f6fa7n@googlegroups.com

reinert <reinkor@gmail.com> 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;

  reply	other threads:[~2022-09-11  8:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-11  7:19 Is this an error in compiler reinert
2022-09-11  8:10 ` Simon Wright [this message]
2022-09-11 10:52   ` reinert
2022-09-11 12:30   ` Jeffrey R.Carter
2022-09-11 12:59     ` Dmitry A. Kazakov
2022-09-11 14:44     ` Niklas Holsti
2022-09-11 15:47       ` Jeffrey R.Carter
2022-09-11 16:47         ` reinert
2022-09-11 17:18           ` Dmitry A. Kazakov
2022-09-12  7:05       ` Simon Wright
2022-09-11 15:14   ` Oliver Kellogg
replies disabled

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