comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: [Technical] Generic child parameterised with instance of parent
Date: 1998/11/26
Date: 1998-11-26T00:00:00+00:00	[thread overview]
Message-ID: <365D6AFE.D3BEE7D1@elca-matrix.ch> (raw)
In-Reply-To: gauthier-2511981816270001@cemrad.unilim.fr

Michel Gauthier wrote:

> Here is the need as I can identify it (possibly not in a right way).

> Then can be compiled. But the compiler rejects
>     package InstChild is new P1Some . Child ( P1Other ) ;

GNAT 3.11b accepts this, and does not need the G1bis declaration, so it
does not seem to take G1 as denoting the current instance within the
generic formal part of G1.Child. I don't know if that is right or not.

Here is the exact code that I compiled:

with G1.Child;

procedure Gauthier_Generic_Child is

   type Some_Type is new Integer;
   type Other_Type is new Float;

   package P1_Some is new G1 ( some_type ) ;
   package P1_Other is new G1 ( other_type ) ;

   package InstChild is new P1_Some . Child ( P1_Other ) ;

begin
   null;
end;
---
generic
   with package GP is new G1 ( <> ) ;
package G1 . Child is
end;
---
generic
   type ITEM is private;
package G1 is
end G1;




  reply	other threads:[~1998-11-26  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-25  0:00 [Technical] Generic child parameterised with instance of parent Michel Gauthier
1998-11-26  0:00 ` Mats Weber [this message]
1998-11-29  0:00   ` Tucker Taft
replies disabled

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