comp.lang.ada
 help / color / mirror / Atom feed
From: "Mark Lundquist" <mark@rational.com>
Subject: Re: Should this be legal?
Date: Thu, 22 Mar 2001 16:29:00 GMT
Date: 2001-03-22T16:29:00+00:00	[thread overview]
Message-ID: <gLpu6.602532$U46.18328780@news1.sttls1.wa.home.com> (raw)
In-Reply-To: 99cjt2$v9g@newsserv.vs.dasa.de


Oliver Kellogg <oliver.kellogg@vs.dasa.de> wrote in message
news:99cjt2$v9g@newsserv.vs.dasa.de...
> Hello Ada experts,
>
> The full declaration of the Derived type looks different than
> the partial view (Base_2 vs. Base(2))
>
> Should this be legal?
> Rational Apex 3.2.0b and GNAT 3.13p both accept it.

Not as you posted it (but I think you cleared this up in another post)

> (However, both compilers tend to have problems with this
> type of construction - especially in more complicated contexts.)

I believe your completion of type Derived is legal, but I'm not a language
lawyer... However, it seems like all the completion rules in 7.3 would
really be unnecessary if the partial and full views were required to "look
the same"...

>
> But then, if Base_2 and Base(2) are supposedly interchangeable,
> how come the function Legal is accepted but function Illegal is
> refused ("constraint not allowed here") ?

Because the construct that follows the "return" must be a subtype_mark, that
is, a name that denotes a (named) subtype (i.e. either the "first subtype"
of a type, or a subtype defined by a subtype declaration).  What you have
there is actually just a syntax error.

Mark Lundquist
Rational Software






  parent reply	other threads:[~2001-03-22 16:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-22 10:13 Should this be legal? Oliver Kellogg
2001-03-22 11:15 ` Martin Dowie
2001-03-22 14:21   ` Oliver Kellogg
2001-03-22 16:29 ` Mark Lundquist [this message]
2001-03-22 16:51   ` Robert A Duff
replies disabled

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