comp.lang.ada
 help / color / mirror / Atom feed
From: stt@henning.camb.inmet.com (Tucker Taft)
Subject: Re: Renaming record discriminants.
Date: 1996/04/01
Date: 1996-04-01T00:00:00+00:00	[thread overview]
Message-ID: <Dp7Eoo.FLK.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: Dp75Aq.B1o@ssd.ray.com

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




  reply	other threads:[~1996-04-01  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-21  0:00 Win32Ada Pascal OBRY
1996-03-21  0:00 ` Win32Ada Robert F. Estes
1996-03-28  0:00   ` Win32Ada Carl J R Johansson
1996-03-28  0:00     ` Win32Ada Ted Dennison
     [not found]       ` <4jf4uhINNsad@RA.DEPT.CS.YALE.EDU>
1996-03-29  0:00         ` Win32Ada Ted Dennison
1996-03-29  0:00   ` Win32Ada lrharris
1996-03-22  0:00 ` Win32Ada Wiljan Derks
1996-04-01  0:00   ` Renaming record discriminants Felaco
1996-04-01  0:00     ` Tucker Taft [this message]
1996-04-01  0:00       ` David Weller
1996-04-02  0:00       ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox