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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,df055ffdd469757d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.172.36 with SMTP id az4mr1975879pac.38.1361113943191; Sun, 17 Feb 2013 07:12:23 -0800 (PST) X-Received: by 10.50.51.129 with SMTP id k1mr790482igo.4.1361113943122; Sun, 17 Feb 2013 07:12:23 -0800 (PST) Path: jm3ni9pbb.0!nntp.google.com!kc14no10004125pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 17 Feb 2013 07:12:22 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=114.163.213.55; posting-account=Mi71UQoAAACnFhXo1NVxPlurinchtkIj NNTP-Posting-Host: 114.163.213.55 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <76e9fde1-3cbb-47e0-b578-b7b9be3ff9c6@googlegroups.com> Subject: Re: Class wide preconditions: error in GNAT implementation? From: ytomino Injection-Date: Sun, 17 Feb 2013 15:12:23 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-02-17T07:12:22-08:00 List-Id: I am not aware of the intention of the writer of AARM (Randy?). Though as far as I read AARM and compare it with the Eiffel book, > O := new B_Pack.T; > Put_Line ("passing 0 to an actual B_Pack.T"); > O.P (0); Calling B_Pack.P via access A_Pack.T'Class should be failure. 6.6.1.38.a/3: > Pre'Class(es) that apply to the subprogram that the dispatching call > is resolving to, not the Pre'Class(es) for the subprogram that is > ultimately dispatched to. "resolving to" = A_Pack.P "dispatched to" = B_Pack.P And, this rule is correspond to page 575 of "Object-Oriented Software Construction 2/E". It indicates that the caller (client) of A_Pack.T('Class) has only contract with A_Pack.T. If the caller want to use weaker contract, the caller should become a direct client of B_Pack.T. The photo of this page has been uploaded in the discussion of dmd: http://d.puremagic.com/issues/show_bug.cgi?id=6857#c84