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 Path: g2news2.google.com!postnews.google.com!p18g2000pra.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Dispatch on the result still does not work? Date: Mon, 13 Jul 2009 11:46:54 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <9f845311-63a4-4d89-ac78-b6567b999417@d4g2000prc.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1247510815 29680 127.0.0.1 (13 Jul 2009 18:46:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 13 Jul 2009 18:46:55 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p18g2000pra.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7034 Date: 2009-07-13T11:46:54-07:00 List-Id: On Jul 13, 8:13=A0am, Adam Beneschan wrote: > I think this also works: > > =A0 =A0 =A0X : T'Class :=3D S'(Value); > =A0 begin > =A0 =A0 =A0declare > =A0 =A0 =A0 =A0 function T_Value return T renames Pak1.Value; > =A0 =A0 =A0begin > =A0 =A0 =A0 =A0 X :=3D T_Value; > =A0 =A0 =A0end; > > Again, the rename helps the compiler determine unambiguously which > Value subprogram is intended, but it doesn't change the fact that the > call to it is tag-indeterminate. =A0I'd need to pore over the rules more > closely to make sure of this, however. OK, I think I got this part wrong. The AARM says that whether a call on a subprogram rename is a dispatching operation depends on where the renaming operation is declared, not on what it renames; here, the rename is not a primitive subprogram (even though the thing it renames *is* primitive), so the call on T_Value is not a dispatching operation and thus can't be tag-indeterminate, and therefore the assignment statement is illegal. GNAT might be getting this wrong. -- Adam > > Anyway, the important thing to remember is that the compiler first has > to determine which declaration is meant by every identifier in a > statement, and only *then* can it think about whether a call is > dispatching or not. > > Hope this helps, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0-- Adam- Hide quoted text - > > - Show quoted text -