From: Preben Randhol <randhol+abuse@pvv.org>
Subject: Problem with Enumaration and visibility
Date: Wed, 14 Nov 2001 13:03:19 +0000 (UTC)
Date: 2001-11-14T13:03:19+00:00 [thread overview]
Message-ID: <slrn9v4uqg.h34.randhol+abuse@kiuk0156.chembio.ntnu.no> (raw)
Hi
I have defined a Enumarated type in a package called setup. I need to
use this in another package called Examine. If I do as below, I get this
error from GNAT:
examine.adb:130:17: operator for type "Method_Enum_Type" defined at
setup.ads:64 is not directly visible
examine.adb:130:17: use clause would make operation legal
examine.adb:130:47: "Spell" is not visible
examine.adb:130:47: non-visible declaration at setup.ads:64
gnatmake: "examine.adb" compilation error
make: *** [all] Error 4
(3 of 8): 17: operator for type "Method_Enum_Type" defined at setup.ads:64
is not directly visible
if I add "use Setup;" in the Start procedure it works. Why do I have
to do this? Is there a different way without using use. I'm just
asking to understand how this works with enumarated types.
Thanks in advance.
-----setup.ads---
package Setup is
-- ...
type Method_Enum_Type is (Spell, MChoice);
procedure Get_Method return Method_Enum_Type;
-- ...
end Setup;
-----examine.adb---
with Setup;
package body Examine is
-- ...
procedure Start is
Method : Setup.Method_Enum_Type := Setup.Get_Method;
begin
if Method = Setup.Method_Enum_Type'(Spell) then
Examine.Spelling.Start;
end if;
end Start;
-- ...
end Examine;
--
Please, stop bombing civilians in Afghanistan. One cannot write off
killing innocent children and other civilians as "collateral damage".
A civilian is a civilian whether he or she is American or from another
country in the world. http://web.amnesty.org/11september.htm
next reply other threads:[~2001-11-14 13:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <slrn9v4uqg.h34.randhol+abuse@kiuk0156.chembio.ntnu.n o>
2001-11-14 13:03 ` Preben Randhol [this message]
2001-11-14 13:48 ` Problem with Enumaration and visibility Wilhelm Spickermann
2001-11-14 16:55 ` Preben Randhol
2001-11-14 15:28 ` Ted Dennison
2001-11-14 16:32 ` Jeffrey Carter
2001-11-14 17:25 ` Preben Randhol
2001-11-14 15:37 Hambut Frumblefoot
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox