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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,772ae8afc5db35f2 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Can't export object of private type Date: 1999/02/28 Message-ID: #1/1 X-Deja-AN: 449654339 Sender: matt@mheaney.ni.net References: <7b1k4h$13k6@news3.newsguy.com> <7b47m3$l2l$1@remarQ.com> NNTP-Posting-Date: Sun, 28 Feb 1999 14:16:31 PDT Newsgroups: comp.lang.ada Date: 1999-02-28T00:00:00+00:00 List-Id: fraser@synopsys.like.how.smart.are.email.greppers.anyway.com writes: > What about a parameterless function that returns that type? The only > down side being that you'd have to override it for each extension. > Or maybe that's not a down side, depending on what you want to do. > > package Test is > > type T is tagged private; > procedure Do_Something (With_T : T); > > function P return T; > -- function P return T'Class might also be what you want. > > private > > type T is tagged null record; > > end Test; This will only work if you don't have to modify the object. To do that, you need to return a reference to the object: function Ref return T_Access; and then say Op (Ref.all); so refer to the actual object.