comp.lang.ada
 help / color / mirror / Atom feed
* access on function returning a class wide type
@ 2002-11-19 21:38 alex
  2002-11-20  0:11 ` James S. Rogers
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: alex @ 2002-11-19 21:38 UTC (permalink / 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/



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-11-20 15:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox