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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d0452dbe16ac0df4 X-Google-Attributes: gid103376,public From: David L Brown Subject: Re: ObjectAda vs Gnat -- bugs Date: 1997/05/16 Message-ID: #1/1 X-Deja-AN: 242861868 Sender: dbrown@ted.vigra.com References: <5lf6ka$nbg@service.polymtl.ca> Organization: VisiCom Laboratories, Inc. Newsgroups: comp.lang.ada Date: 1997-05-16T00:00:00+00:00 List-Id: dewar@merv.cs.nyu.edu (Robert Dewar) writes: > Well I am not sure where you get the "probably gnat" from, but in this case > it seems obvious that GNAT is right, unless I am missing something. You > have an object renaming declaration and you are trying to rename a functoin. > The GNAT message seems correct (I suppose that it would be nice if it would > remind you that an enumeration literal is a function and not an object, since > it is true that this can be a bit of a surprise! Actually, this shows an inconsistency with GNAT between enumeration literals, and actual functions. 1. procedure T1 is 2. type Items is (Item); 3. 4. Item_2 : Items renames Item; | >>> expect object name in renaming 5. function Item_3 return Items renames Item; 6. Item_4 : Items renames Item_3; 7. 8. function Hoo_Haa return Items is 9. begin 10. return Item; 11. end Hoo_Haa; 12. 13. Hoo_2 : Items renames Hoo_Haa; 14. 15. begin 16. null; 17. end T1; GNAT correctly renames the "real" function "Item_3", but is not able to rename the enumeration literal. Dave Brown