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: stt@henning.camb.inmet.com (Tucker Taft) Subject: Re: Renaming record discriminants. Date: 1996/04/01 Message-ID: #1/1 X-Deja-AN: 145300501 sender: news@inmet.camb.inmet.com (USENET news) x-nntp-posting-host: henning.camb.inmet.com references: organization: Intermetrics, Inc. newsgroups: comp.lang.ada Date: 1996-04-01T00:00:00+00:00 List-Id: Felaco (bcf@ssd.ray.com) wrote: : 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)] If it really complains, then this is a compiler bug. I have not been able to reproduce this problem with a recent version of this compiler, so you should submit a formal bug report if you have a (ideally minimal) test case that shows the problem. : ... Why can't I rename the discriminant? You can rename a discriminant. Either the compiler has a bug, or the example was more complicated and perhaps there was some subtlety not communicated in the above description. : Note that in the real code, the Object is an 'in' parameter. In general, if you have a question like this, post an entire, ideally minimal, test case. When typing in a test from memory, it is very easy to leave out the critical piece of information that could explain the seemingly mysterious behavior. : 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? It sounds like a compiler bug, but a complete minimal test case would make it clearer. : Thanks... : Chris Felaco Phone: x4631 (Raynet 444, Local 842) : Raytheon Company Email: bcf@ssd.ray.com -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Cambridge, MA USA