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-7-bit X-Google-Thread: 103376,1dcef85eb875c8db X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-12 08:03:16 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: Dispatching to a common most special ancestor Date: 12 Jun 2003 08:03:16 -0700 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0306120703.d3fd5f2@posting.google.com> References: NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1055430196 24461 127.0.0.1 (12 Jun 2003 15:03:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 12 Jun 2003 15:03:16 GMT Xref: archiver1.google.com comp.lang.ada:39053 Date: 2003-06-12T15:03:16+00:00 List-Id: Stephan Heinemann wrote in message news:... > > 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;