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,760a0492b97ae06e,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-18 10:24:29 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: favierp@sofreavia.fr (Pierre Favier) Newsgroups: comp.lang.ada Subject: How to test object hierarchy Date: 18 Dec 2003 10:24:29 -0800 Organization: http://groups.google.com Message-ID: <93172edb.0312181024.9a536b2@posting.google.com> NNTP-Posting-Host: 81.57.206.83 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1071771869 10841 127.0.0.1 (18 Dec 2003 18:24:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 18 Dec 2003 18:24:29 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:3538 Date: 2003-12-18T10:24:29-08:00 List-Id: I am wondering how to test for two objects which types both derive from a common root type if one of them derives from the other. In short, I am trying to run something like the following code which does not compile because the Class attribute applies to types or subtypes but not to objects: procedure Test_Hierarchy (Obj1 : in Root_Object'Class; Obj2 : in Root_Object'Class) is begin if Obj1 in Obj2'Class then -- Do something else -- Do something else end if; end Test_Hierarchy; Any suggestions on how to achieve the intended effect?