comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@on2.com (Matthew Heaney)
Subject: Re: Dispatching to a common most special ancestor
Date: 12 Jun 2003 08:03:16 -0700
Date: 2003-06-12T15:03:16+00:00	[thread overview]
Message-ID: <1ec946d1.0306120703.d3fd5f2@posting.google.com> (raw)
In-Reply-To: bc8cnl$in0$1@news.cs.tu-berlin.de

Stephan Heinemann <zombie@cs.tu-berlin.de> wrote in message news:<bc8cnl$in0$1@news.cs.tu-berlin.de>...
> 
> I wanted Equals to be dispatched to the common object ancestor but
> instead a constraint error is raised. How might I resolve this?

Equals is primitive for the type, which means that the tags of both
objects must match.

One solution is to make the operation dispatch on only the first
object:

function Equals 
  (O1 : access Object;
   O2 : access Object'Class) return Boolean;

Alternatively, you can make Equals a class-wide operation, and then
internally dispatch as necessary:

function Equals (O1, O2 : access Object'Class) return Boolean;



      parent reply	other threads:[~2003-06-12 15:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-11 23:07 Dispatching to a common most special ancestor Stephan Heinemann
2003-06-12  6:08 ` Dmitry A. Kazakov
2003-06-12 11:29 ` Georg Bauhaus
2003-06-12 15:03 ` 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