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,436e4ce138981b82,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-02 11:01:57 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: evangeli@cnam.fr (Evangelista Sami) Newsgroups: comp.lang.ada Subject: abstract sub programs overriding Date: 2 Mar 2004 11:01:56 -0800 Organization: http://groups.google.com Message-ID: <5f59677c.0403021101.4ac263d0@posting.google.com> NNTP-Posting-Host: 163.173.228.31 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1078254117 6354 127.0.0.1 (2 Mar 2004 19:01:57 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 2 Mar 2004 19:01:57 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:6014 Date: 2004-03-02T11:01:56-08:00 List-Id: hello all i have a class hierarchy with 3 levels and an abstract procedure : ----------------------------- type t1 is abstract tagged record ... end record; procedure proc(my_t : in t1) is abstract; type t2 is abstract new t1 with record ... end record; procedure proc(my_t : in t2); type t3 is new t2 with record ... end record; type access_t3 is access all t3; function new_t3 return access_t3; ----------------------------- function new_t3 only create a t3 object and return it. Now i have this procedure : ----------------------------- procedure generate is access_t3 : t3 := new_t3; begin proc(access_t3.all); end; ----------------------------- how is it that the "proc(access_t3.all);" call raise "CONSTRAINT_ERROR : generator.adb:93 access check failed" i thought it would be correct since i have overriden proc for type t2 and t3 inherits from t2. what's wrong? what would be the solution? thanks