comp.lang.ada
 help / color / mirror / Atom feed
From: alex <xela@netcourrier.com>
Subject: access on function returning a class wide type
Date: 19 Nov 2002 21:38:32 GMT
Date: 2002-11-19T21:38:32+00:00	[thread overview]
Message-ID: <20021119-223832-295143@foorum.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 819 bytes --]


Is there a �workaround/trick� to implement this kind of think.

package A is
   type A_T is abstract tagged null record;
   function Fa return A_T is abstract;
   type Fa_Ptr is access function return A_T'Class;
end A;

with A;
package B is
  type B_T is new A.A_T with null record ;
  function Fa return B_T;
end B;

package body B is
  function Fa return B_T is
  begin return (A.A_T with null record);
  end Fa;
end B;

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!


-- 
Ce message a ete poste via la plateforme Web club-Internet.fr
This message has been posted by the Web platform club-Internet.fr

http://forums.club-internet.fr/



             reply	other threads:[~2002-11-19 21:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-19 21:38 alex [this message]
2002-11-20  0:11 ` access on function returning a class wide type 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
replies disabled

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