comp.lang.ada
 help / color / mirror / Atom feed
From: Andrea Taverna <a.tavs@hotmail.it>
Subject: Re: Visibility of package parameters in child packages
Date: Wed, 16 Dec 2009 06:21:18 -0800 (PST)
Date: 2009-12-16T06:21:18-08:00	[thread overview]
Message-ID: <06a89bbe-6b1d-4996-b699-8da81bc6806a@m11g2000vbo.googlegroups.com> (raw)
In-Reply-To: 4b28dd43$0$6586$9b4e6d93@newsspool3.arcor-online.net

On 16 Dic, 14:14, Georg Bauhaus <rm.dash-bauh...@futureapps.de> wrote:
> Andrea Taverna schrieb:
>
> > and the compiler replied
>
> > -----%<-----%<-----%<-----%<-----%<
> > ]# gnatmake main.adb
> > gcc -c main.adb
> > main.adb:9:05: instantiation error at parent-child.adb:6
> > main.adb:9:05: "F" is not visible (more references follow)
> > main.adb:9:05: instantiation error at parent-child.adb:6
> > main.adb:9:05: non-visible declaration at q.ads:3
> > gnatmake: "main.adb" compilation error
> > -----%<-----%<-----%<-----%<-----%<
>
> > Am I missing something?
>
> It's not a "use" issue I think.  P.F is marked invisible,
> too.
I'm not sure I understand you correctly here, however P.F *is*
visible, in fact the compiler stops complaining after prefixig P's
name to F.

>  Can you try this:
>
> generic
>    with package P is new Q(<>);
>    use P;
> package Parent is
>
>    function P_F(X : P.T) return P.T
>      renames P.F;
>
> and then call P_F in place of F.

I'd rather rename P to a shorter name.

thanks,

Andrea



  reply	other threads:[~2009-12-16 14:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 19:28 Visibility of package parameters in child packages Andrea Taverna
2009-12-15 21:00 ` Georg Bauhaus
2009-12-16 11:50   ` Andrea Taverna
2009-12-16 13:14     ` Georg Bauhaus
2009-12-16 14:21       ` Andrea Taverna [this message]
2009-12-16 15:54         ` Georg Bauhaus
2009-12-16 16:54           ` Andrea Taverna
2009-12-16 18:54             ` Georg Bauhaus
2009-12-16 21:44               ` Adam Beneschan
2009-12-16 21:26             ` sjw
2009-12-17  0:19     ` Randy Brukardt
2009-12-17 18:50       ` Ludovic Brenta
2009-12-16 21:27 ` Adam Beneschan
replies disabled

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