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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,48484d95b03e1d36 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-01 00:51:18 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: keld.nielsen@agip.it (Keld Lund Nielsen) Newsgroups: comp.lang.ada Subject: Re: Visibility problems in Parent.Child configuration Date: 1 Aug 2002 00:51:18 -0700 Organization: http://groups.google.com/ Message-ID: <383f908a.0207312351.b2d5c36@posting.google.com> References: <383f908a.0207300341.1047c075@posting.google.com> <719a5d07.0207310257.63c9645@posting.google.com> NNTP-Posting-Host: 151.96.0.8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1028188278 19557 127.0.0.1 (1 Aug 2002 07:51:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 1 Aug 2002 07:51:18 GMT Xref: archiver1.google.com comp.lang.ada:27555 Date: 2002-08-01T07:51:18+00:00 List-Id: t_wolf@angelfire.com (Thomas Wolf) wrote in message news:<719a5d07.0207310257.63c9645@posting.google.com>... > keld.nielsen@agip.it (Keld Lund Nielsen) wrote in message news:<383f908a.0207300341.1047c075@posting.google.com>... > > Dear All, > > > > a question regarding type visibility. The configuration is as follows: > > > > ----file Parent.ads: > > with Ada.Numerics.Generic_Elementary_Functions; > > package Parent is > > > > package Float_64 is > > type Instance is digits 15; > > for Instance'Size use 64; > > package Operations is > > new Ada.Numerics.Generic_Elementary_Functions( Instance ); > > end Float_64; > > > > end Parent; > > > > ----file Parent.Generic_Child.ads: > > generic > > type Instance is private; > > > > package Parent.Generic_Child is > > --void... > > end Parent.Generic_Child; > > > > > > Then I create a test system with the structure: > > > > Test.Parent.Child > > > > but when I try to create an instance of Generic_Child or just declare > > a subtype of the Parent.Float_64.Instance, then the compiler protests > > and gives the message that Float_64 is not in Parent! > > > > Moreover, when instantiated from a simple package - say "my_package" - > > then it works perfectly, yet not from the "Test.Parent.Child". > > That's because if you do e.g. > > package Test.Parent.Child is > > subtype My_Float is Parent.Float_64.Instance; > > end Test.Parent.Child; > > the name "Parent" refers to package "Test.Parent", not > to package "Parent". To refer from within "Test.Parent" or > one of its children to the top-level package "Parent", use > "Standard.Parent". E.g. > > package Test.Parent.Child is > > subtype My_Float is Standard.Parent.Float_64.Instance; > > end Test.Parent.Child; > > should work. It DOES work - thank you very much. Cheers Keld