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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,640b65cbfbab7216 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!l42g2000hsc.googlegroups.com!not-for-mail From: Eric Hughes Newsgroups: comp.lang.ada Subject: Re: Ada.Strings.Bounded Date: Tue, 22 Apr 2008 08:30:24 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8ce7177e-fdf6-4942-ad5e-f64e92e34d16@l42g2000hsc.googlegroups.com> References: <1wh7cbu67y4wz$.7iu8likx0fct.dlg@40tude.net> <144w648u50r6q.1erjxxu0cplbw.dlg@40tude.net> <611360e0-595c-43a7-b5cb-137a278ec0c1@s13g2000prd.googlegroups.com> <15389tuelo6x6$.1c1a6yixordts$.dlg@40tude.net> <4c1be2a2-0178-4c1f-8c96-526020550f42@w4g2000prd.googlegroups.com> <15514187-d7d0-4650-a058-13ec5684be2c@w5g2000prd.googlegroups.com> <07e98c4f-9b79-412f-9e95-94dd04082355@p39g2000prm.googlegroups.com> <81b0ae55-12a6-44e4-8481-3753b05d4464@f24g2000prh.googlegroups.com> <2b5c47f7-04f6-4530-b8d0-2a0b730a0fbd@y22g2000prd.googlegroups.com> NNTP-Posting-Host: 166.70.57.218 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1208878224 15068 127.0.0.1 (22 Apr 2008 15:30:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 22 Apr 2008 15:30:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l42g2000hsc.googlegroups.com; posting-host=166.70.57.218; posting-account=5RIiTwoAAACt_Eu87gmPAJMoMTeMz-rn User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:21033 Date: 2008-04-22T08:30:24-07:00 List-Id: On Apr 21, 7:02 pm, Adam Beneschan wrote: > The expected type is Z; therefore, in > example C, the only possible meaning for "-" is the function that > takes two arguments of type Z and returns Z. That, in turn, applies > to "+". So it's 100% clear from the language rules what functions are > called by this expression. The reason it doesn't raise > Constraint_Error is 4.9(33), as I mentioned earlier. OK. But then what's the type of the subexpression "( Z0 + 1 )" within the static expression "( Z0 + 1 ) - 1"? It can't be of type Z, since it's outside the bounds of type Z. And the addition chosen can't be the same addition as the declared one, which returns Z, and that subexpression returns something that's not in Z. The addition used here has a different signature. It seems that the overload resolution rules don't apply when universal_integer is involved. This seems a pretty obvious consequence of 4.9(33). Eric