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=-0.8 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d74cdcee29b02bcc X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!u72g2000hsf.googlegroups.com!not-for-mail From: Tony Newsgroups: comp.lang.ada Subject: Re: Discriminant ans tagged type ?! Date: Fri, 21 Mar 2008 01:18:58 -0700 (PDT) Organization: http://groups.google.com Message-ID: <25164625-2bf7-4cea-b4fa-dc1422588446@u72g2000hsf.googlegroups.com> References: <47dfde3d$0$26828$426a74cc@news.free.fr> <6d529059-8109-4b17-845e-2a6e1430321c@i7g2000prf.googlegroups.com> NNTP-Posting-Host: 86.64.47.77 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1206087539 5738 127.0.0.1 (21 Mar 2008 08:18:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 21 Mar 2008 08:18:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u72g2000hsf.googlegroups.com; posting-host=86.64.47.77; posting-account=NPvXCgoAAACeAnV0vTvzXKjbTtI1j27n User-Agent: G2/1.0 X-HTTP-Via: 1.0 31L-PEGASUS X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20525 Date: 2008-03-21T01:18:58-07:00 List-Id: On 18 mar, 20:54, Adam Beneschan wrote: > On Mar 18, 8:54 am, Adam Beneschan wrote: > > > However, I tried changing the declaration of T as follows: > > > T : String (1 .. B.L); > > > and GNAT accepted it. (I haven't done enough testing to make sure > > GNAT handles it correctly in other ways, though.) Here, B refers to > > the "current instance" of the type (8.6(17)), and 3.7(18) means that > > all instances of the type will have a component L that is inherited > > from A, so this should be legal unless there are some other rules that > > I've missed (and that GNAT also missed). > > Never mind. After reading Bob's post, I got pointed to 3.8(10-12), > which disallows references to inherited discriminants in a type > extension. So I guess GNAT (or at least the version I'm using, which > is probably not the latest) is wrong to accept this. Sorry. > > -- Adam -- I tried Bob's answer with the Aonix compiler: ERROR : LRM:3.8(12), A discriminant used in a constraint may only appear alone as a direct_name. I'm lost...;-) Is my first code correct? I guess yes... Tony