comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: which compiler is right?
Date: Tue, 16 Mar 2004 15:56:18 +0100
Date: 2004-03-16T15:56:18+01:00	[thread overview]
Message-ID: <mo4e50p2pf9ra0drsjb2hjiq51kqfc4ne0@4ax.com> (raw)
In-Reply-To: mailman.97.1079444714.327.comp.lang.ada@ada-france.org

On Tue, 16 Mar 2004 14:44:27 +0100, Lionel.DRAGHI@fr.thalesgroup.com
wrote:

>Could someone, please, tell me if this code compile with other compilers
>than GNAT and ObjectAda?
>Or even better, is ObjectAda right in rejecting it?
>
>Thanks in advance

package Pkg1 is
   type T_Event is abstract tagged null record;
   function Priority (Event : T_Event) return Natural is abstract;
end Pkg1;
-- ---------------------------------------------------------------
with Pkg1;
generic
   type T_Event (<>) is new Pkg1.T_Event with private;
package Pkg2 is
   function Priority (Event : in T_Event) return Natural;

Looks much like GNAT error. In any case the above makes little sense.
If you want to override Priority you should declare a new type in
Pkg2:

generic
   type T_Event (<>) is abstract new Pkg1.T_Event with private;
package Pkg2 is
   type New_T_Event is new T_Event with null record;
   function Priority (Event : in New_T_Event) return Natural;

--
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



  reply	other threads:[~2004-03-16 14:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-16 13:44 which compiler is right? Lionel.DRAGHI
2004-03-16 14:56 ` Dmitry A. Kazakov [this message]
2004-03-16 23:43 ` Randy Brukardt
2004-03-17 17:27 ` Adam Beneschan
2004-03-18  5:07   ` Randy Brukardt
2004-03-18 20:33     ` Adam Beneschan
2004-03-19 19:48       ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2004-03-17 18:56 Lionel.DRAGHI
2004-03-17 18:53 Lionel.DRAGHI
2004-03-18  4:57 ` Randy Brukardt
2004-03-17 10:16 Lionel.DRAGHI
2004-03-17 17:48 ` Randy Brukardt
2004-03-16 15:35 Lionel.DRAGHI
1997-07-24  0:00 Which compiler is right ? Strategies
1997-07-25  0:00 ` Tucker Taft
1997-07-25  0:00 ` Albert K. Lee
replies disabled

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