comp.lang.ada
 help / color / mirror / Atom feed
From: blaak@mda.ca (Ray Blaak)
Subject: Re: GNAT Problem on recursive generics?
Date: 1996/12/02
Date: 1996-12-02T00:00:00+00:00	[thread overview]
Message-ID: <57v0mp$a0d@sparky.mda.ca> (raw)
In-Reply-To: 57moem$phr@sun04.tfh-berlin.de


Recursion is certainly allowable. The problem is something else: e is "in out",
but you are passing in a function result ('pred or 'succ) which is a constant.
GNAT (correctly) does no find any foo with that profile.

Either change e to "in", or assign to a variable before calling foo again.

Cheers,
Ray Blaak
blaak@mda.ca

weberwu@compute.tfh-berlin.de (Debora Weber-Wulff) writes:

>Ran into this problem in GNAT 3.05 using the IDE on a PC the other
>day:

>-- foo.adb
>procedure foo (e: in out element) is
>   begin
>   if 1=1 then
>     foo(element'pred(e));
>   else
>     foo(element'succ(e));
>end if;
>end foo;
>	>>> "foo" is not visible (more references follow)
>	>>> non-visible declaration at foo.ads:3




  parent reply	other threads:[~1996-12-02  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-29  0:00 GNAT Problem on recursive generics? Debora Weber-Wulff
1996-12-01  0:00 ` Robert Dewar
1996-12-02  0:00 ` Ray Blaak [this message]
1996-12-03  0:00   ` Debora Weber-Wulff
1996-12-03  0:00     ` Robert Dewar
replies disabled

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