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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a3c2ec05bff4ab48,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!aioe.org!not-for-mail From: Dennis Hoppe Newsgroups: comp.lang.ada Subject: Ada: Inheritance of generics Date: Mon, 02 Jun 2008 15:39:05 +0200 Organization: Aioe.org NNTP Server Message-ID: NNTP-Posting-Host: rfxIqsNOOcYSVIzBT0cW8Q.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) Xref: g2news1.google.com comp.lang.ada:517 Date: 2008-06-02T15:39:05+02:00 List-Id: Hi, 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; function Example return Integer; end Generic_Child; -- testsuite package Parent is new Generic_Parent (2**16); package Child is new Parent.Object; -- compiler error, no selector for ... A : Integer := Child.Example; My aim is to append some generic childs to a container and iterate over each item and call a common procedure or function. Best regards, Dennis Hoppe