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,758ad7877a64226f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-11 17:12:08 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc04.POSTED!not-for-mail Message-ID: <3EBEE6D3.8080302@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: deallocating class wide types References: <3ebcea42$1_4@news.arrakis.es> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.62.164.137 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc04 1052698326 24.62.164.137 (Mon, 12 May 2003 00:12:06 GMT) NNTP-Posting-Date: Mon, 12 May 2003 00:12:06 GMT Organization: AT&T Broadband Date: Mon, 12 May 2003 00:12:06 GMT Xref: archiver1.google.com comp.lang.ada:37212 Date: 2003-05-12T00:12:06+00:00 List-Id: alfonso acosta wrote: > procedure Destroy (Object: in out My_Class_Access) renames Free; > > end My_Class; > ---------------------------------------------------------------- > > I get: > my_class.adb:7:59: subprogram used in renaming_as_body cannot be intrinsic The error tells you that since the calling convention for Destroy doesn't match the calling convention for Free, you can't use renaming as body. You could either put the renaming in the package spec, or another solution is to declare Destroy as a "wrapper" subroutine: procedure Destroy (Object: in out My_Class_Access) is begin Free(Object); end Destroy; If you are really worried about the possibility that this will add run time overhead, you can put: pragma Inline(Destroy); in the package spec. It is usually put in the private part, because the user of the package doesn't need to know about it.