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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5631add016610868,start X-Google-Attributes: gid103376,public From: ddavenpo@redwood.hac.com (Darren C Davenport) Subject: Ada95 visibility problem Date: 1996/02/23 Message-ID: <4gl9on$8o4@hacgate2.hac.com>#1/1 X-Deja-AN: 140861673 organization: Hughes Aircraft Company newsgroups: comp.lang.ada Date: 1996-02-23T00:00:00+00:00 List-Id: I don't understand why a generic child package can't see components of a package nested in it's generic parent. This could be a compiler problem (GNAT 3.01) but I'm not sure. Here's an example: (and don't even think about commenting on style) ------------------------------------------------------------------- generic package x is package z is function c return integer; end z; use z; end x; package body x is package body z is function c return integer is begin return 1; end c; end z; end x; generic package x.d is function d return integer; end x.d; package body x.d is function d return integer is begin return c; end d; end x.d; with x; package k is new x; with x.d; package k.l is new k.d; ------------------------------------------------------------------- When I compile k-l.ads I get the following: GNAT Compiler Version 3.01 Copyright 1995 Free Software Foundation, Inc. Compiling: k-l.ads (source file time stamp: 1996-02-23 20:47:21) ==============Error messages for source file: x-d.adb 3. function d return integer is begin return c; end d; | >>> "c" is not visible >>> non-visible declaration at x.ads:5 3 lines: 2 errors Now, if package x is not generic all is well. What's the difference? An instantiation of a generic package x should be just as good as a non-generic package x. Thanks for any insights. Darren