comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr>
Subject: Re: generic formal object of class-wide type
Date: 1999/04/29
Date: 1999-04-30T06:28:46+00:00	[thread overview]
Message-ID: <7gbiiu$hp5$1@wanadoo.fr> (raw)
In-Reply-To: m3d80nsu54.fsf@mheaney.ni.net

Matthew Heaney a �crit dans le message ...
>When I try to compile package Q (see below), I get this error:
>
>q.ads:3:25: type of actual does not match type of "O"
>
>Why?
>
>Generic formal object O (in GQ) is of type P.T'Class.
>
>Actual object O is of specific type NT, yes, but that type is in
>T'Class.  So why isn't object O allowed as the actual for formal
GC.O?
>
If the formal is declared as P.T'Class, the actual has to be P.T'Class
(P.T'Class IS a type that follows (mostly) usual typing rules).
If you want to allow for a type IN the class, you say that it is
derived from P.T:

generic
   type D is new P.T with private;
---------------------------------------------------------
           J-P. Rosen (Rosen.Adalog@wanadoo.fr)
Visit Adalog's web site at http://perso.wanadoo.fr/adalog






      parent reply	other threads:[~1999-04-29  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-29  0:00 generic formal object of class-wide type Matthew Heaney
1999-04-29  0:00 ` David C. Hoos, Sr.
1999-04-29  0:00   ` Matthew Heaney
1999-04-30  0:00     ` Robert A Duff
1999-04-30  0:00       ` Richard D Riehle
1999-04-29  0:00 ` Jean-Pierre Rosen [this message]
replies disabled

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