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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a4f7279a5480f28c,start X-Google-Attributes: gid103376,public From: ehsjony@ehs.ericsson.se (Jonas Nygren) Subject: private types - controlled Date: 1996/02/24 Message-ID: <4gmubj$4c4@erinews.ericsson.se>#1/1 X-Deja-AN: 140886918 distribution: world organization: Ericsson followup-to: comp.lang.ada reply-to: ehsjony@ehs.ericsson.se newsgroups: comp.lang.ada Date: 1996-02-24T00:00:00+00:00 List-Id: I am trying to write support for shared objects using reference counts and Ada.Finalization. The shared object should be possible to extend while the references should not. Further I would like to have two version of references which could be used to provide "different interfaces" to the same object in an implementation, constant and non-constant. I also want to be able to convert from non-constant to constant but not the other way around. So my code looks something like this: with Ada.Finalization; package Shared_Objects is type Shared_Object is tagged private; type Constant_Reference is private; type Reference is private; function To_Constant (R : Reference) return Constant_Reference; private type Shared_Object is ....; type Constant_Reference is new Ada.Finalization.Controlled with ...; type Reference is new Constant_Reference with null record; end Shared_Objects; The problem I get here is To_Constant. Gnat says: sharobje.ads:36:09: type must be declared abstract or "To_Constant" overridden (line 36 being the line 'type Reference is new Constant_Reference with null record;') I really don't understand what I should do to get this to work - what should I do to get this to work? (I know about not having two controlling operands in a function interface but at the point of declaration the types Reference and Constant_Reference are private and hence, To_Constant is not a 'primitive operation' of any tagged object) /jonas