comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: type access Parent'Class
Date: Mon, 21 Nov 2011 14:09:28 -0700
Date: 2011-11-21T14:09:28-07:00	[thread overview]
Message-ID: <jaeeq7$i71$1@tornado.tornevall.net> (raw)
In-Reply-To: <7fd768a4-f97b-4045-8bab-49d2a3897a61@p2g2000vbj.googlegroups.com>

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



      parent reply	other threads:[~2011-11-21 21:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21 19:03 type access Parent'Class Yukicanis
2011-11-21 19:25 ` Adam Beneschan
2011-11-21 19:40   ` Yukicanis
2011-11-21 19:45     ` Robert A Duff
2011-11-21 19:46       ` Yukicanis
2011-11-21 23:45   ` Gene
2011-11-22  8:42     ` Dmitry A. Kazakov
2011-11-22 10:07       ` Georg Bauhaus
2011-11-22 13:27         ` Simon Wright
2011-11-22 16:13           ` Georg Bauhaus
2011-11-21 19:33 ` Robert A Duff
2011-11-21 19:44   ` Yukicanis
2011-11-24 10:33   ` Yannick Duchêne (Hibou57)
2011-11-24 11:18     ` Yukicanis
2011-11-21 21:09 ` Jeffrey Carter [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox