comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
Subject: Re: aliased variables
Date: 1998/08/13
Date: 1998-08-13T00:00:00+00:00	[thread overview]
Message-ID: <a0El56px9GA.189@samson.airnet.net> (raw)
In-Reply-To: 35D264A8.FC025A5F@cmis.csiro.au


Richard Beare wrote in message <35D264A8.FC025A5F@cmis.csiro.au>...
>Hi,
>I am having a problem trying to get a program with an aliased variable
>to compile. I'm sure I'm missing something obvious

The problem is that your program does not conform to the rule expresssed in
the following sentence of RM 3.10 (9):
If the view defined by an object_declaration is aliased, and the type of the
object has discriminants, then the object is constrained; if its nominal
subtype is unconstrained, then the object is constrained by its initial
value.

Since K's nominal subtype is unconstrained, the object must be constrained
not by explicit bounds, but by its initial value.

The solution is to declare K as follows:
   K : aliased Mt := (1 .. 10 => 0);

David C. Hoos, Sr.







  reply	other threads:[~1998-08-13  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-13  0:00 aliased variables Richard Beare
1998-08-13  0:00 ` David C. Hoos, Sr. [this message]
1998-08-13  0:00 ` Tucker Taft
1998-08-14  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