From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,83b83c553c3b79cf,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-14 05:17:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!news1.ebone.net!news.ebone.net!news.net.uni-c.dk!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Problem with Enumaration and visibility Date: Wed, 14 Nov 2001 13:03:19 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: NNTP-Posting-Host: kiuk0156.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1005742999 15594 129.241.83.82 (14 Nov 2001 13:03:19 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Wed, 14 Nov 2001 13:03:19 +0000 (UTC) User-Agent: slrn/0.9.7.2 (Linux) Xref: archiver1.google.com comp.lang.ada:16493 Date: 2001-11-14T13:03:19+00:00 List-Id: 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