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 X-Google-Thread: 103376,a9a99a861147e2f8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-20 07:32:31 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: access on function returning a class wide type Date: 20 Nov 2002 07:32:31 -0800 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0211200732.6b3c034a@posting.google.com> References: <20021119-223832-295143@foorum.com> NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1037806351 24608 127.0.0.1 (20 Nov 2002 15:32:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 20 Nov 2002 15:32:31 GMT Xref: archiver1.google.com comp.lang.ada:31132 Date: 2002-11-20T15:32:31+00:00 List-Id: alex 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;