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,edd7ea1b2d7e9a18 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-13 05:32:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!zen.net.uk!news.cabal.org.uk!news-peer.gradwell.net!not-for-mail Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 References: From: porton@ex-code.com (Victor Porton) Subject: Re: Pitfall: freeing access discriminants Newsgroups: comp.lang.ada Content-Type: text/plain; charset=us-ascii Message-ID: Date: Thu, 13 Feb 2003 17:07:59 +0500 Organization: Extreme Code Software (http://ex-code.com) X-URL: http://www.ex-code.com/ NNTP-Posting-Date: 13 Feb 2003 13:32:25 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1045143145 news.gradwell.net 351 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:34050 Date: 2003-02-13T13:32:25+00:00 List-Id: In article , porton@ex-code.com (Victor Porton) writes: > type Integer_Access is access Integer; > > type T(D: access Integer) is Ada.Limited_Controlled with null record; > > procedure Finalize(Object: in out T) is > -- Error: cannot convert access discriminant to non-local access type > D: Integer_Access := Integer_Access(Object.D); > begin > Free(D); > end; > > What to do? It seems being a serious deficiency in Ada or there are a > workaround? I found a solution myself: Base: Base_Element_Access := Object.Base.all'Unchecked_Access;