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,b6e8251cd11c860d X-Google-Attributes: gid103376,public From: bcf@ssd.ray.com (Felaco) Subject: Renaming record discriminants. Date: 1996/04/01 Message-ID: #1/1 X-Deja-AN: 145286874 sender: news@ssd.ray.com (Administrator) x-nntp-posting-host: shamu.ssd.ray.com references: <3152FC34.648B@nl.cis.philips.com> organization: Raytheon Electronic Systems, Portsmouth RI Facility newsgroups: comp.lang.ada Date: 1996-04-01T00:00:00+00:00 List-Id: I just tried do something like the following: type Record_Type(Has_Value : Boolean) is record case Has_Value is when True => Value : Integer; when False => null; end case; Object : Record_Type := (Has_Value => True, Value => 1); Discriminant : Boolean renames Object.Has_Value; -- error Component : Integer renames Object.Value; -- error (there may be a typo or something in there, this is off the top of my head) The Intermetrics compiler I am using complains that: Object.Has_Value depends on discriminants of an unconstrained formal parameter with default discriminants [RM_95 8.5.1(5)] RM_95 8.5.1(5) reads: The renamed entity shall not be a subcomponent that depends on discriminants of a variable whose nominal subtype is unconstrained, unless this subtype is indefinite, or the variable is aliased. A slice of an array shall not be renamed if this restriction disallows renaming of the array. This says to me that the second renames I have is illegal. I am not sure why the first renames is illegal. Why can't I rename the discriminant? Note that in the real code, the Object is an 'in' parameter. I'm not sure if this is a language issue, a compiler problem, or just a lack of understanding on my part. Could anyone help clarify? Thanks... -- ------------------------------------------------------------------------------- Chris Felaco Phone: x4631 (Raynet 444, Local 842) Raytheon Company Email: bcf@ssd.ray.com -------------------------------------------------------------------------------