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,9d8db3defac005a2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-19 07:48:18 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Renaming an abstract function Date: 19 Nov 2001 10:38:56 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <9t1lp1$16unne$1@ID-25716.news.dfncis.de> <3BF6DE1F.6C31A357@home.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1006184491 10193 128.183.220.71 (19 Nov 2001 15:41:31 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 19 Nov 2001 15:41:31 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:16686 Date: 2001-11-19T15:41:31+00:00 List-Id: Mark Biggar writes: > type> > > > package Test1 is > > > type T is abstract tagged limited private; > > > function P (X, Y: in T) return T is abstract; > > > function "*" (A, B: in T) return T renames P; -- error line > > > private > > > type T is abstract tagged limited null record; > > > end; > There is an AI that addresses this problem: > > >!standard 8.5.4 (7) 00-07-12 >AI95-00211/06 > >!class ramification 98-11-18 > >!status Response 2000 00-01-24 > >!status WG9 approved 99-06-12 > >!status ARG Approved (with changes) 8-0-1 99-03-24 > >!status work item 98-11-18 > >!priority Medium > >!difficulty Easy > >!qualifier Clarification > >!subject Can an abstract subprogram be renamed? > > > >!summary > > > >An abstract subprogram can be renamed, and the renamed view is also > >abstract. Such a renaming must appear in a place where the declaration > >of an abstract subprogram would be legal. Similarly, the "shall be >overridden" > >property of 3.9.3(6) applies to a renamed view. Thus, any renaming of an > >inherited subprogram that must be overridden is illegal. > > This explains the compilation error as the renaming "*" is a must be > overridden function as it has an abstract return type and thus is > illegal. > Well, the full text of the AI talks about renaming an _inherited_ subprogram, not the abstract subprogram itself. It does not discuss exactly what should happen for this case. Simply following the rules for inheriting abstract subprograms, you are required to give an overriding subprogram for any derived type. Thus, if the renaming is valid, you'd have to override both P and "*", which is surely not the intent. So it seems reasonable to conclude that the renaming itself is invalid. We could propose a "renaming inheritance" rule that says an equivalent renaming is applied to the overriding subprogram; that is the intent of this renaming. -- -- Stephe