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=0.6 required=5.0 tests=BAYES_05,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!caip!princeton!siemens!gypsy!esmith From: esmith@gypsy.UUCP Newsgroups: net.lang.ada Subject: Re: Ada language problem/question Message-ID: <38000031@gypsy.UUCP> Date: Wed, 9-Jul-86 11:18:00 EDT Article-I.D.: gypsy.38000031 Posted: Wed Jul 9 11:18:00 1986 Date-Received: Fri, 11-Jul-86 21:57:34 EDT References: <91@houligan.UUCP> Nf-ID: #R:houligan:-9100:gypsy:38000031:000:1065 Nf-From: gypsy!esmith Jul 9 11:18:00 1986 List-Id: Your compiler does the right thing. A subtype declaration does not derive any operations (read "enumeration literals"). If you change the assignment in package B to y := st_2 or y := B.st_2 you will see that the literals aren't locally defined in B, therefore they can't be made available anywhere else through the use of a "with B". Note that if you must do this, and a derived type won't do what you want, you can use renaming declarations: package fruit_mgr is type fruit is (apple, banana, cherry); end fruit_mgt; with fruit_mgr; package pseudo_fruit_mgr is subtype fruit is fruit_mgr.fruit; function apple return fruit renames fruit_mgr.fruit; function banana return fruit renames fruit_mgr.banana; function cherry return fruit renames fruit_mgr.cherry; end pseude_fruit_mgr; You can, of course, just declare constants of type pseudo_fruit_mgr.fruit instead: apple: constant fruit := fruit_mgr.apple; but this method does not preserve the semantics of enumeration literals, particularly with reference to overloading.