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-Thread: 103376,532862505ad62ff5 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!e9g2000prf.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Does 3.9.3(10) apply to untagged private whose full view is tagged? Date: Thu, 26 Jul 2007 08:07:51 -0700 Organization: http://groups.google.com Message-ID: <1185462471.150936.319550@e9g2000prf.googlegroups.com> References: <1185401098.912519.245650@z28g2000prd.googlegroups.com> <1185446419.28126.44.camel@kartoffel> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1185462472 18903 127.0.0.1 (26 Jul 2007 15:07:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 26 Jul 2007 15:07:52 +0000 (UTC) In-Reply-To: <1185446419.28126.44.camel@kartoffel> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: e9g2000prf.googlegroups.com; posting-host=66.126.103.122; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:1209 Date: 2007-07-26T08:07:51-07:00 List-Id: On Jul 26, 3:40 am, Georg Bauhaus wrote: > On Thu, 2007-07-26 at 08:58 +0000, anon wrote: > > Compiling: pak1.ads (source file time stamp: 2007-07-25 03:27:16) > > > 1. package Pak1 is > > 2. type T1 is private; > > 3. > > 4. private > > 5. type T1 is tagged record > > 6. F1 : Integer; > > 7. end record; > > 8. function Func (X : Integer) return T1 ; > > | > > >>> private function with tagged result must override visible-part function > > >>> move subprogram to the visible part (RM 3.9.3(10)) > > > 9. end Pak1; > > 10. > > Ada 95: RM 3.9.3 (10) says > > ... For a tagged > > type declared in a visible part, > > T1 is not visibly tagged nor abstract. The RM rule seems to apply > to visibly tagged types. I'd, too, be interested in a continuation > of GNAT's first message: "must override visible-part function > for a type that is ...". The wording of GNAT's message is a bit sideways IMHO. In general, for a visibly tagged type, the rule is that you can't have a function with a controlling result that returns that type in the private part; the exception to the rule is in the case where the visible type is derived and the function with a controlling result overrides an inherited function. The GNAT phrasing makes it seem like the "exceptional" case here is the normal case, and that the mistake is not making the function override something. I think their message may be logically equivalent to the real rule (using "logically equivalent" in a mathematical sense), but the emphasis is wrong, which could cause users to be confused. -- Adam