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,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,12eefe849df97d15 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!newsfeed01.chello.at!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 16 Dec 2009 14:14:42 +0100 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Visibility of package parameters in child packages References: <4b27f8e9$0$6591$9b4e6d93@newsspool3.arcor-online.net> <02e4d172-0eb9-4c2a-ac0f-68e151916d59@o19g2000vbj.googlegroups.com> In-Reply-To: <02e4d172-0eb9-4c2a-ac0f-68e151916d59@o19g2000vbj.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4b28dd43$0$6586$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 16 Dec 2009 14:14:43 CET NNTP-Posting-Host: d9fafa43.newsspool3.arcor-online.net X-Trace: DXC=N8jn4G@hAmhj5k5aEF7ISmMcF=Q^Z^V3h4Fo<]lROoRa8kFjLh>_cHTX3jmKICmkGnO6^o X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:8398 Date: 2009-12-16T14:14:43+01:00 List-Id: 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. 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 think it has (remotely?) to do with an issue hat Eric Hughes had with Ada formal packages when trying C++ patterns; IIRC, it was not reported to the producers of the compiler. Also, there seems to have been some change in Ada 2005 LRM 12.7 from Ada 95 around the (<>) of a generic formal package, but I don't know whether that is matters here.