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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC,WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,90f9274f3d61ec1e,start X-Google-Attributes: gid103376,public From: ehsjony@ehs.ericsson.se (Jonas Nygren) Subject: Problem with type derivation and packages Date: 1996/02/18 Message-ID: <4g79ul$ikh@erinews.ericsson.se>#1/1 X-Deja-AN: 139884223 distribution: world organization: Ericsson followup-to: comp.lang.ada reply-to: ehsjony@ehs.ericsson.se newsgroups: comp.lang.ada Date: 1996-02-18T00:00:00+00:00 List-Id: I am experiencing a problem which I don't understand and followingly can't correct. I hope somebody in c.l.a can help me. I try to implement a container type which share data structures. This works in a different version but when I reorganized my code I got a strange error message from Gnat (3.01, Sun Solaris). When compiling my little test program, Test2, I got the following messages from Gnat: gcc -c -k8 test2.adb test2.adb:3:04: expected private type "Reference" defined at sharobje.ads:26 test2.adb:3:04: found private type "Container" defined at containe.ads:17 Test2: ====== with Int_Conts; use Int_Conts.Int_Cont; procedure Test2 is C : Container; begin null; end Test2; I simply cannot understand why Gnat expects 'private type "Reference"' when I have declared a Container? I want to declare a Container and not a Reference! What am I doing wrong? Any help is appreciated, /jonas Below follows the rest of the spec files - some shortened to problem essentials. These files can be run through Gnat without any error reports. Int_Conts: ========== with Containers; package Int_Conts is package Int_Cont is new Containers(Integer); end Int_Conts; Containers: =========== with Shared_Objects; generic type Container_Item is private; package Containers is type Container is private; -- some decls removed private type Store is array(Index range <>) of aliased Container_Item; package Shared_Store is new Shared_Objects(Store); use Shared_Store; type Container is new Shared_Store.Reference; -- some decls removed end Containers; Shared_Objects: =============== with Ada.Finalization; generic type Object(<>) is private; package Shared_Objects is type Object_Access is access all Object; type Reference is private; -- some decls removed private type Shared_Object is record Ref_Count : Natural; Obj_Ref : Object_access; end record; type Shared_Object_Ref is access all Shared_Object; type Reference is new Ada.Finalization.Controlled with record Ref : Shared_Object_Ref := null; end record; -- some decls removed end Shared_Objects;