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,b031c56dc601135 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!postnews1.google.com!not-for-mail From: 402450@cepsz.unizar.es (Jano) Newsgroups: comp.lang.ada Subject: Re: Problem with access parameter Date: 25 May 2004 07:58:01 -0700 Organization: http://groups.google.com Message-ID: <5d6fdb61.0405250658.3a657420@posting.google.com> References: <5d6fdb61.0405250252.3a1f1f68@posting.google.com> NNTP-Posting-Host: 155.210.155.44 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1085497081 16112 127.0.0.1 (25 May 2004 14:58:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 25 May 2004 14:58:01 +0000 (UTC) Xref: controlnews3.google.com comp.lang.ada:817 Date: 2004-05-25T07:58:01-07:00 List-Id: Forget about it, I've found some flaws in my reasoning to do this. Thanks anyway. 402450@cepsz.unizar.es (Jano) wrote in message news:<5d6fdb61.0405250252.3a1f1f68@posting.google.com>... > Hi, > > I'm trying to finalize data inside a protected type, using the > approach pasted at the end. I'm not sure if I get this bizarre error > because of a Gnat 3.15p bug or because what I'm trying is illegal: > > agpl-counter-multi.ads:59:04: expected an access type with designated > type "Object" defined at line 59 > agpl-counter-multi.ads:59:04: found an access type with designated > type derived from "Object" defined at line 59 > agpl-counter-multi.ads:59:04: ==> in call to "_Init_Proc" at line 73 > > The package code is: (trimmed) > > package Agpl.Counter.Multi is > > type Object; > type Object_Access is access all Object; > > type Destructor_Type (Parent : access Object) is limited private; > > ---------------------------------------------------------------- > -- Object -- > ---------------------------------------------------------------- > protected type Object is > -- Things > private > procedure Destroy; > Destructor : Destructor_Type (Object'Access); > Values : Counter_Map.Container_Type; > end Object; > > private > > type Destructor_Type (Parent : access Object) is new > Finalization.Limited_Controlled with null record; > > procedure Finalize (This : in out Destructor_Type); > -- Here call to This.Parent.Destroy; > > end Agpl.Counter.Multi;