comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adambeneschan@aol.com>
Subject: Re: orthogonal inheritance and extension aggregates
Date: Fri, 19 Jul 2013 11:00:34 -0700 (PDT)
Date: 2013-07-19T11:00:34-07:00	[thread overview]
Message-ID: <6995bf02-6143-4d0f-aeb3-89a94bc1ac01@googlegroups.com> (raw)
In-Reply-To: <ksbu1u$75k$1@online.de>

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:

> 
>     generic
>        type Parent (<>) is abstract tagged private;
>     package Extension is
>        type Extended is abstract new Parent with private;
> 
>        -- operations of the extended type here
>     private
>        type Extended is abstract new Parent with record
>           -- …
>        end record;
>     end Extension;
> 
> Now for testing, I tried to apply this on a Vector:
> 
>     package Int_Vectors is new Ada.Container.Vectors (Natural, Integer);
>     package Base is new Extension (Int_Vectors.Vector);
> 
>     type Child is new Base.Extended with null record;
> 
> 
> At the declaration of Child, GNAT tells me "type must be declared 
> abstract or "To_Vector" overridden". Can someone explain why this 
> happens? As I understand it, To_Vector should be automatically defined 
> for the derived type. Is this because the intermediate type Extended is 
> declared abstract? Or because To_Vector dispatches in the return type?

This looks like a GNAT bug to me.

                                 -- Adam

  reply	other threads:[~2013-07-19 18:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 17:46 orthogonal inheritance and extension aggregates Felix Krause
2013-07-19 18:00 ` Adam Beneschan [this message]
2013-07-22 16:02   ` Adam Beneschan
2013-07-22 18:44     ` Dmitry A. Kazakov
2013-07-22 18:59     ` Adam Beneschan
2013-07-22 19:19       ` Adam Beneschan
2013-07-22 22:03       ` Felix Krause
2013-07-19 19:05 ` Dmitry A. Kazakov
2013-07-20  5:49   ` Randy Brukardt
2013-07-20  6:36     ` Dmitry A. Kazakov
2013-07-20  7:54       ` Niklas Holsti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox