From: mheaney@on2.com (Matthew Heaney)
Subject: Re: access on function returning a class wide type
Date: 20 Nov 2002 07:32:31 -0800
Date: 2002-11-20T15:32:31+00:00 [thread overview]
Message-ID: <1ec946d1.0211200732.6b3c034a@posting.google.com> (raw)
In-Reply-To: 20021119-223832-295143@foorum.com
alex <xela@netcourrier.com> wrote in message news:<20021119-223832-295143@foorum.com>...
>
> with A,B;
> procedure Test is
> Ptr : A.Fa_Ptr := B.Fa'access; -- error : LRM:8.6(28)
> begin null;
> end Test;
>
> The compiler is expecting a function returning a A_T'Class, ok I understand�
> But, B_T is in the A_T'Class!
Do this instead:
procedure Test is
B_Object : aliased B_T'Class := Fa;
Ptr : constant Fa_Ptr := B_Object'Unchecked_Access;
begin
null;
end;
prev parent reply other threads:[~2002-11-20 15:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-19 21:38 access on function returning a class wide type alex
2002-11-20 0:11 ` James S. Rogers
2002-11-20 6:39 ` alex
2002-11-20 8:43 ` Jean-Pierre Rosen
2002-11-20 12:39 ` Dmitry A. Kazakov
2002-11-20 15:32 ` Matthew Heaney [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