comp.lang.ada
 help / color / mirror / Atom feed
From: petter.fryklund.konsult@dynamics.saab.se (Petter Fryklund)
Subject: Dispatching problem.
Date: 6 Feb 2003 06:04:51 -0800
Date: 2003-02-06T14:04:51+00:00	[thread overview]
Message-ID: <f74cb448.0302060604.e808c22@posting.google.com> (raw)

We have the following:

package A is
  type Msg;
  type Msg_Ptr is access all Msg'Class;
  type Msg is abstract tagged null record;
  ... other declarations

  type M1 is new Msg with ....
  type M1_Ptr is access all M1;
  type M2 is new Msg with ....
  type M2_Ptr is access all M2;
  ... other declarations

  function X (Param : Integer) return Msg_Ptr;
end A;

with A;
package B is 
  type Msg is abstract new A.Msg with null record;
  type Msg_Ptr is access all Msg;
  type B1 is new A.M1 with null record;
  type B1_Ptr is access all B1;
  type B2 is new A.M1 with null record;
  type B2_Ptr is access all B2;

  procedure Y (MP : access B1);
  procedure Y (MP : access B2); 
end B;

with A;
with B;
procedure Main is

   X : A.Msg_Ptr;
   Y : A.Msg_Ptr;
begin
   X := A.X (1);        -- Building a A.M1
   Y := A.X (2);        -- Building a A.M2
   B.Y (B.Msg_Ptr (X)); -- causes Constraint_Error Tag Check Failed to be raised. 
end Main;

How can we dispatch in package B?



             reply	other threads:[~2003-02-06 14:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-06 14:04 Petter Fryklund [this message]
2003-02-06 15:33 ` Dispatching problem James S. Rogers
2003-02-07  7:35   ` Petter Fryklund
2003-02-07  9:01 ` Dmitry A. Kazakov
2003-02-07 14:55   ` Petter Fryklund
2003-02-10  9:12     ` Dmitry A. Kazakov
2003-02-11  8:31       ` Petter Fryklund
  -- strict thread matches above, loose matches on Subject: below --
2008-01-15 18:55 petter_fryklund
2008-01-15 19:49 ` Dmitry A. Kazakov
2008-01-15 20:01   ` petter_fryklund
replies disabled

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