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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5a88548f1bcf3510 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Received: by 10.66.79.6 with SMTP id f6mr968340pax.3.1353057383323; Fri, 16 Nov 2012 01:16:23 -0800 (PST) Path: 6ni89286pbd.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!novia!news-hub.siol.net!news1.t-com.hr!newsfeed.CARNet.hr!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Overring function and its returned type Date: Fri, 9 Nov 2012 14:11:38 +0100 Organization: cbb software GmbH Message-ID: <16xl96g780qw8.1nc3x394b8m68.dlg@40tude.net> References: <1vej4u29b8e4z$.289wazkl31wg$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Date: 2012-11-09T14:11:38+01:00 List-Id: On Fri, 09 Nov 2012 10:14:32 +0100, Yannick Duch�ne (Hibou57) wrote: > Le Fri, 09 Nov 2012 09:24:18 +0100, Dmitry A. Kazakov > a �crit: > >> On Fri, 09 Nov 2012 08:13:23 +0100, Yannick Duch�ne (Hibou57) wrote: >> >>> overriding >>> function F >>> (E : T) >>> return R'Class -- Not overriding :-( >>> is abstract; >> >> What is this? "overriding" + "abstract" does not make sense. > > Overriding sometime do nothing, just remind something, recall an inherited > definition explicitly. No, overriding *always* does something. It overrides the part of the polymorphic body it specifies. ------------ Alas, I overlooked that you used "R" for two different types. Yet another argument for consequent use of "use" clauses! Down with "with" (:-)) I don't see a good reason why nominal type equivalence should be further eroded. When you derive a new interface you get another type. It may have operations of its own. So, it is not automatically compatible. A more general question is about overriding out-operations to narrower subtypes, and/or overriding in-operations to wider subtypes. That could work. Specifically regarding class-wide types they are not considered subtypes. I believe there could be too many conflicts to make them subtypes. I mean a model in which when S is derived from T, then S'Class is a subtype of T'Class (constrained to S and its descendants). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de