From: dewar@gnat.com
Subject: Re: Positional Aggregates
Date: 1998/11/12
Date: 1998-11-12T00:00:00+00:00 [thread overview]
Message-ID: <72dk3n$tda$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 72cq2h$7bd$1@nnrp1.dejanews.com
In article <72cq2h$7bd$1@nnrp1.dejanews.com>,
dennison@telepath.com wrote:
> > error: positional aggregate cannot have
> > one component
> >
> > Is this valid for an array with only one element?
>
> It never worked for me before. Try
>
> Files_Index : array (1..Files_Used) of Integer :=
> (others => 17);
>
> BTW: That's the best error message for that error I've
> ever seen.
Thankyou for that nice note! The GNAT circuit for producing
this error message is indeed a little tricky, but we found
it was a common error and thus worth the effort to special
case the error message :-)
Strictly of course (17) simply is not an aggregate at all
but just a parenthesized expression. What GNAT does here is
to specially check for a parenthesized expression of type
foo in a context expecting array-of-foo.
Robert Dewar
Ada Core Technologies
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
next prev parent reply other threads:[~1998-11-12 0:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-11-11 0:00 Positional Aggregates John McCabe
1998-11-11 0:00 ` dennison
1998-11-12 0:00 ` dewar [this message]
1998-11-12 0:00 ` John McCabe
1998-11-12 0:00 ` dewarr
1998-11-11 0:00 ` John McCabe
1998-11-12 0:00 ` dewarr
1998-11-12 0:00 ` John McCabe
1998-11-11 0:00 ` Marc A. Criley
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox