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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3e5f85a85cdab16e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-22 08:32:43 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!ucberkeley!enews.sgi.com!newshub2.rdc1.sfba.home.com!news.home.com!news1.sttls1.wa.home.com.POSTED!not-for-mail From: "Mark Lundquist" Newsgroups: comp.lang.ada References: <99cjt2$v9g@newsserv.vs.dasa.de> Subject: Re: Should this be legal? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: Date: Thu, 22 Mar 2001 16:29:00 GMT NNTP-Posting-Host: 24.20.66.55 X-Complaints-To: abuse@home.net X-Trace: news1.sttls1.wa.home.com 985278540 24.20.66.55 (Thu, 22 Mar 2001 08:29:00 PST) NNTP-Posting-Date: Thu, 22 Mar 2001 08:29:00 PST Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: supernews.google.com comp.lang.ada:5997 Date: 2001-03-22T16:29:00+00:00 List-Id: Oliver Kellogg 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