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,d402e2c741db0d0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-10 11:09:14 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Language lawyer question: Equality on 'Access attributes Date: 10 Jan 2004 14:09:14 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4LKdnRRNyv6AlmCiRVn-ig@comcast.com> <6bSdnYBKy_diPGCi4p2dnA@gbronline.com> <5a6dnSHERdpJtWOi4p2dnA@gbronline.com> NNTP-Posting-Host: pip1-5.std.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1073761754 13602 192.74.137.185 (10 Jan 2004 19:09:14 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 10 Jan 2004 19:09:14 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:4315 Date: 2004-01-10T14:09:14-05:00 List-Id: "Robert I. Eachus" writes: > So let me take the example and modify it a bit: > > package Pak1 is > type Ptr1 is access Integer; > X : aliased Integer; > Y : aliased Integer; > B : Boolean := X'Access = Y'Access; > end Pak1; I guess all you did was erase the "all"? > Is your position Bob, that this version is illegal? Yes. There's only one "=" of interest here. So the expected type of X'Access is Ptr1, which is not a general access type. You can't do X'Access returning a non-general access type. In other words, overload resolution works the same as in the other example, but there's a legality rule being violated. >...Now there is no > visible general access type, or at least none that the user can see. Well, I'm presuming you're showing me the whole example! If there are some other "=" operators visible that I can't see, then who knows? > What is the expected type of "=" above? Boolean. Not sure what you mean... >...Can we use the fact that > anonymous access types don't have equality operators. I don't see any anonymous access types in the example. But yes, if there were, the "=" operators that are visible would not include ones for those anonymous types. And resolution would proceed accordingly. > Whew! First, 3.10.2(2) was a Name Resolution Rule, so it can't make a > construct illegal. However, 4.5.2(6) is "Static Semantics." Can it be > considered in a name resolution context? Yes. >... And if so does it make a > construct illegal, or rule it out of consideration. It just tells us which implicit declarations exist. That information affects overload resolution. - Bob