comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Generic Formal With Discrim Used As Actual - How?
Date: 1998/10/25
Date: 1998-10-25T00:00:00+00:00	[thread overview]
Message-ID: <m3af2l77o2.fsf@mheaney.ni.net> (raw)

I'm having trouble passing generic formal types --one of which has an
access discriminant-- as generic actuals to another generic having an
identical profile.  Something like:

generic
   type T1 (<>) is limited private;
   type T2 (O : access T1) is limited private;
procedure GP;

generic
   type T1 (<>) is limited private;
   type T2 (O : access T1) is limited private;
procedure GQ;

with GQ;
procedure GP is
  procedure Q is new GQ (T1, T2);
begin
   null;
end GP;


When I try to compile the body of GP, I get the following message:

(start of compiler message)
gnatf /home/matt/acl/rings/gp.adb
gp.adb:4:30: types of actual discriminants must match formal
gp.adb:4:30: instantiation abandoned

Compilation exited abnormally with code 1 at Sun Oct 25 01:13:09
(end of compiler message)


Can someone explain what's going on here?  Why doesn't this code compile?

Is there any way to pass a formal type with a discriminant as the actual
type of another instantiation?

Thanks,
Matt






             reply	other threads:[~1998-10-25  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-25  0:00 Matthew Heaney [this message]
1998-10-25  0:00 ` Generic Formal With Discrim Used As Actual - How? 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