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,4200259190b16e16 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-27 08:30:21 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!tar-atanamir.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Visibility problems with package instantiations..... Date: Thu, 27 Nov 2003 17:33:50 +0100 Message-ID: <349csv0udb5k0kuk0q99d7tm7fh5leuefu@4ax.com> References: <95234e08.0311270742.631b1228@posting.google.com> NNTP-Posting-Host: tar-atanamir.cbb-automation.de (212.79.194.116) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1069950619 65721855 212.79.194.116 ([77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:2995 Date: 2003-11-27T17:33:50+01:00 List-Id: On 27 Nov 2003 07:42:40 -0800, petter.fryklund@atero.se (Petter Fryklund) wrote: >We have the following: > >generic > type A is mod (<>); > type B is mod (<>); >package Gen_0 is > type C is > record > AA : A; > BB : B; > end record; >end Gen_0; > >with Gen_0; >generic > with package Inst_0 is new Gen_0 (<>); >package Gen_1 is > procedure X (P1 : Inst_0.C); >end Gen_1; > >with Gen_0; + with Gen_1; -- I suppose >generic > with package Inst_0 is new Gen_0 (<>); > with package Inst_1 is new Gen_1 (<>); >package Gen_2 is > procedure X (P1 : Inst_0.C); >end Gen_2; > >package body Gen_2 is > procedure X (P1 : Inst_0.C) is > begin > Inst_1 (P1); <---- visibility problems. Inst_1.X (P1); -- Probably Provided that my assuptions are correct then Inst_1.X cannot be called with Inst_0.C, because Inst_1.Inst_0.C and Inst_0.C are different types, at least for the compiler. So either 1. they are not and should not be, then: generic with package Inst_0 is new Gen_0 (<>); with package Inst_1 is new Gen_1 (<>); package Gen_2 is procedure X (P1 : Inst_1.Inst_0.C); -- The right type is Inst_1.Inst_0.C end Gen_2; 2. they should be same, then generic with package Inst_0 is new Gen_0 (<>); with package Inst_1 is new Gen_1 (Inst_0); -- Inst_1 shall be instantiated with Inst_0 package Gen_2 is procedure X (P1 : Inst_0.C); end Gen_2; -- Regards, Dmitry Kazakov http://www.dmitry-kazakov.de