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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.86.200 with SMTP id t8mr22748283qal.0.1374256835361; Fri, 19 Jul 2013 11:00:35 -0700 (PDT) X-Received: by 10.182.65.202 with SMTP id z10mr369174obs.36.1374256835212; Fri, 19 Jul 2013 11:00:35 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder02.blueworldhosting.com!news.ripco.com!news.glorb.com!u2no47460qao.0!news-out.google.com!dk8ni705qab.0!nntp.google.com!f1no53084qae.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 19 Jul 2013 11:00:34 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=RxNzCgoAAACA5KmgtFQuaU-WaH7rjnAO NNTP-Posting-Host: 66.126.103.122 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6995bf02-6143-4d0f-aeb3-89a94bc1ac01@googlegroups.com> Subject: Re: orthogonal inheritance and extension aggregates From: Adam Beneschan Injection-Date: Fri, 19 Jul 2013 18:00:35 +0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:16433 Date: 2013-07-19T11:00:34-07:00 List-Id: On Friday, July 19, 2013 10:46:38 AM UTC-7, Felix Krause wrote: > I try to implement some feature via orthogonal inhertance like this: >=20 > generic > type Parent (<>) is abstract tagged private; > package Extension is > type Extended is abstract new Parent with private; >=20 > -- operations of the extended type here > private > type Extended is abstract new Parent with record > -- =85 > end record; > end Extension; >=20 > Now for testing, I tried to apply this on a Vector: >=20 > package Int_Vectors is new Ada.Container.Vectors (Natural, Integer); > package Base is new Extension (Int_Vectors.Vector); >=20 > type Child is new Base.Extended with null record; >=20 >=20 > At the declaration of Child, GNAT tells me "type must be declared=20 > abstract or "To_Vector" overridden". Can someone explain why this=20 > happens? As I understand it, To_Vector should be automatically defined=20 > for the derived type. Is this because the intermediate type Extended is= =20 > declared abstract? Or because To_Vector dispatches in the return type? This looks like a GNAT bug to me. -- Adam