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: a07f3367d7,97652a7fcb504670 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!y17g2000yqn.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Got warnings when overriding Initialize and Finalize Date: Fri, 10 Jul 2009 09:12:04 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <16dc507c-4b96-4b53-b46f-2e806f988e6e@h18g2000yqj.googlegroups.com> NNTP-Posting-Host: 86.75.149.226 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1247242324 13310 127.0.0.1 (10 Jul 2009 16:12:04 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 10 Jul 2009 16:12:04 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y17g2000yqn.googlegroups.com; posting-host=86.75.149.226; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6948 Date: 2009-07-10T09:12:04-07:00 List-Id: On 10 juil, 17:34, Adam Beneschan wrote: > There is a case, involving *untagged* types, where overriding an > operation in the private part can lead to some unexpected results: > > =A0 =A0package Pak2 is > =A0 =A0 =A0 type T2 is new Pak1.T; > =A0 =A0 =A0 -- inherits operation Op > =A0 =A0private > =A0 =A0 =A0 overriding procedure Op (X : T2); > =A0 =A0end Pak2; > > Now, calling Op on an object of type T2 may give you either the > inherited one or the overriding one, depending on whether the private > part of Pak2 is visible at that point. Indeed, this example is a bad practice > It may be that the compiler, > with this case in mind, displays a warning any time there's an > override in the private part of a package .... and it does not take care it is a tagged type so Your idea of the reason why is clever