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,37d92c79f7959c1f,start X-Google-Attributes: gid103376,public From: "Marc A. Criley" Subject: Generic instantiation in client vs child package Date: 1998/10/13 Message-ID: <36234017.2AB1975B@lmco.com>#1/1 X-Deja-AN: 400587406 Content-Transfer-Encoding: 7bit Organization: Lockheed Martin M&DS Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-10-13T00:00:00+00:00 List-Id: The following behavior is seen with GNAT 3.11b-beta on Linux 2.0.33 (COL 1.2). When instantiating a particular generic from Corey Minyard's "Ada Structured Library" (http://www.concentric.net/~Minyard) I get a clean compile in one situation and an error in another, and I'm not sure why. I expect it's something I'm overlooking in Ada 95. Given a simple package spec: -- plain.ads package Plain is type P is private; private type P is new Integer; end Plain; The following instantiation of a dynamic list in a client package compiles cleanly: -- plain_list.ads with ASGC.List.Dynamic; -- from ASL 1.0 with Plain; package Plain_List is package P_Container is new ASGC(Contained_Type => Plain.P, "=" => Plain."="); package P_List is new P_Container.List; package P_List_Dyn is new P_List.Dynamic; end Plain_List; However, if I instantiate within a child, rather than client, package: -- plain-list.ads with ASGC.List.Dynamic; package Plain.List is package P_Container is new ASGC(Contained_Type => P, "=" => "="); package P_List is new P_Container.List; package P_List_Dyn is new P_List.Dynamic; end Plain.List; I get this error: plain-list.ads:9:04: instantiation error at asgc-list-dynamic.ads:26 plain-list.ads:9:04: "Object" not declared in "List" plain-list.ads:9:04: instantiation error at asgc-list-dynamic.ads:27 plain-list.ads:9:04: tagged type required, found type "Object" defined at asgc-list-dynamic.ads:26, instance at line 9 Why is this instantiation acceptable in a client package, but not in a child package? -- Marc A. Criley Chief Software Architect Lockheed Martin ATWCS marc.a.criley@lmco.com Phone: (610) 354-7861 Fax : (610) 354-7308