From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 11 Sep 91 20:16:07 GMT From: csus.edu!wupost!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!uv aarpa!software.org!smithd@ucdavis.ucdavis.edu (Doug Smith) Subject: Re: why are these unknown identifiers? Message-ID: <1991Sep11.201607.3148@software.org> List-Id: In article <9109101616.aa26718@PARIS.ICS.UCI.EDU> jduarte@liege.ICS.UCI.EDU (Jo se Duarte) writes: > ----------------------------------------- > package X is > type DIRECTIONS is (UP,DOWN,LEFT,RIGHT); > end X; > ----------------------------------------- > with X; > package Y is > subtype DIRECTIONS is X.DIRECTIONS; replace the subtype declaration with a derived type: type Directions is new X.Directions; > end Y; > ----------------------------------------- remove extraneous with of Text_IO. > with Y; > procedure BUG is > > V1 : Y.Directions := Y.UP; -- Y.UP is unknown > V2 : Y.Directions := Y.DOWN; -- Y.DOWN is unknown > > begin > null; > end BUG; > > Can someone tell me why "Y.UP" and "Y.DOWN" are unknown identifiers > within the procedure BUG? I have to "with X" and then assign X.UP > and X.DOWN to V1 and V2 in order to compile this. Why is this the case? > Is this an Ada pecularity or a compiler bug? > > > Thanks! > JOSE DUARTE Make the above change from subtype to derived type to accomplish what you were trying (I didn't see any reason to with Text_IO). Of course, you will find other differences which you may not like, such as the need for explicit type conversions. Now you can study the differences between subtypes and derived types (I have never been able to do better than the LRM, and will let others "explain" the differences).