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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a3c2ec05bff4ab48 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada: Inheritance of generics Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Mon, 2 Jun 2008 15:51:05 +0200 Message-ID: <1d2swajw7rsue$.ftt2098a7wvt$.dlg@40tude.net> NNTP-Posting-Date: 02 Jun 2008 15:51:06 CEST NNTP-Posting-Host: 0631b648.newsspool4.arcor-online.net X-Trace: DXC=9E=_aA=^`lVmG86`U=_nC_4IUK\BH3YRNbJ\lX_>gN]DNcfSJ;bb[UFCTGGVUmh?TLK[5LiR>kgR602ISllZ[oV X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:518 Date: 2008-06-02T15:51:06+02:00 List-Id: On Mon, 02 Jun 2008 15:39:05 +0200, Dennis Hoppe wrote: > I managed to implement a generic parent class and create a generic unit, > which is a child of the first one. I wonder, why I have access to > procedures and functions of the parent class, if I am "within" the child > unit, but if I am "outside", the compiler complains that no selector for > a specified function exists. > > -- generic parent > generic > type Modular_Type is mod <>; > package Generic_Parent is > type Object is abstract tagged limited null record; > > function Example return Integer; > end Generic_Parent; > > -- child unit > generic > -- omitted > package Generic_Child is > type Object is new Generic_Parent.Object with private; This is illegal. Generic_Parent is a generic unit, you cannot refer to anything within it without either instantiation of, or else from a generic child unit of. Generic_Child is not a child package of Generic_Parent. P.S. Except for trivial cases, it is always better to post complete code samples. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de