comp.lang.ada
 help / color / mirror / Atom feed
From: Andre Spiegel <spiegel@berlin.informatik.uni-stuttgart.de>
Subject: Re: Using Controlled type objects.
Date: 1996/08/01
Date: 1996-08-01T00:00:00+00:00	[thread overview]
Message-ID: <lhm7mrjoz9f.fsf@berlin.berlin.informatik.uni-stuttgart.de> (raw)
In-Reply-To: 32008E75.6A3F@ncl.ac.uk


Andrea Coccoli writes:

> When I compile it, I receive this message:
> genstack.ads:#: controlled type must be declared at the library level 

The problem is that you are trying to instantiate the generic inside
your main procedure -- and hence, the controlled type is not at the
library level.  The error message is a bit misleading, because it is
reported for the declaration within the generic package.  But that one
obviously *is* at the library level.  [I think I've heard rumours that
the GNAT team wants to enhance that error message, maybe they already
did so, are you using the current version of GNAT?]

Anyway, the solution is to instantiate the generic separately, like

    package My_Stack is new Reusable (...)

as a compilation unit on its own, and then "with" that unit into your
main procedure.




      parent reply	other threads:[~1996-08-01  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-01  0:00 Using Controlled type objects Andrea Coccoli
1996-08-01  0:00 ` Robert A Duff
1996-08-01  0:00 ` Pascal Ledru
1996-08-01  0:00 ` Andre Spiegel [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