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=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,dfdb3e9be36e818e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.59.229 with SMTP id c5mr288628pbr.6.1321909770742; Mon, 21 Nov 2011 13:09:30 -0800 (PST) Path: lh20ni2805pbb.0!nntp.google.com!news1.google.com!goblin1!goblin.stu.neva.ru!news.tornevall.net!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: type access Parent'Class Date: Mon, 21 Nov 2011 14:09:28 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <7fd768a4-f97b-4045-8bab-49d2a3897a61@p2g2000vbj.googlegroups.com> NNTP-Posting-Host: d5f46f7876606eb8f224a4bbc8c6dc80 Mime-Version: 1.0 X-Trace: d1e14af36b980ba1c8f56f418bbf69e4 X-Complaints-To: abuse@tornevall.net User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: <7fd768a4-f97b-4045-8bab-49d2a3897a61@p2g2000vbj.googlegroups.com> X-UserIDNumber: 1738 X-Validate-Post: http://news.tornevall.net/validate.php?trace=d1e14af36b980ba1c8f56f418bbf69e4 X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Xref: news1.google.com comp.lang.ada:19007 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-11-21T14:09:28-07:00 List-Id: On 11/21/2011 12:03 PM, Yukicanis wrote: > > procedure Test is > type Parent is tagged limited null record; > type Parent_Access is access Parent'Class; > A : access Parent'Class; > B : Parent_Access; > procedure Dyn_Disp(X : access Parent'Class) is > begin > A := X; > B := X; > end Dyn_Disp; > begin > null; > end Test; > > When I try to complie that with GNAT 4.6.1 I get the following error > message: > > test.adb:9:10: expected type "Parent_Access" defined at line 3 > test.adb:9:10: found type access to "Parent'Class" defined at line 6 > > which I don't really understand since type "Parent_Access" is type > access to Parent'Class, isn't it? The message should really say "found anonymous type access to ...", which points to the solution: don't use anonymous types. -- Jeff Carter "My mind is aglow with whirling, transient nodes of thought, careening through a cosmic vapor of invention." Blazing Saddles 85