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,f19c50942e86e617 X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: aliased variables Date: 1998/08/13 Message-ID: #1/1 X-Deja-AN: 380701593 References: <35D264A8.FC025A5F@cmis.csiro.au> Newsgroups: comp.lang.ada X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Date: 1998-08-13T00:00:00+00:00 List-Id: 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.