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-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!bolzen.all.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: overriding in private part Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <45b4a4cc-13f5-4175-9061-9c962e32d762@64g2000hsm.googlegroups.com> <47e26a8d-d104-46c5-b841-667f6e556792@w7g2000hsa.googlegroups.com> Date: Fri, 3 Oct 2008 10:52:52 +0200 Message-ID: NNTP-Posting-Date: 03 Oct 2008 10:52:52 CEST NNTP-Posting-Host: 8798704a.newsspool2.arcor-online.net X-Trace: DXC=]Ad1\YAeOi6^8FBo0_81f>A9EHlD;3Yc24Fo<]lROoR14nDHegD_]R5L^Yg8@b1WA>DNcfSJ;bb[5IRnRBaCd__ZO0P0FGQ On Thu, 2 Oct 2008 09:42:28 -0700 (PDT), Adam Beneschan wrote: > In general, the language doesn't want to take private declarations of > the parent into account when deciding whether something is > overriding. This is OK, but the problem is that the operation is formally considered private when it is obviously (in common sense) not. > Your case is a little more confusing because, like the above example, > there's an invisible P2 operation of the parent type that shouldn't > affect the behavior, but this is inherited from a P2 operation of the > *grandparent* type that *is* visible in the private part of A1.A3. > Perhaps the compiler should generate a warning about the possible > confusion in this case. If we didn't have an "overriding" keyword, I > might even go so far as to suggest the language should make this case > illegal, in order to prevent this kind of case from coming up. It is not the overriding which must be illegal. The opposite should. I mean it should be: overriding procedure P2 (X : Child); -- Legal (presently illegal) not overriding procedure P2 (X : Child); -- Illegal (presently legal) > But > since "overriding" has been added, you should just use it, and it will > solve the problem. Unfortunately it does not. The programmer desired to override P2, and this is impossible to do, because there is a type in between which effectively *hides* the operation in all packages, regardless their visibility. Further, this behavior changes when the offending type is derived in A1 rather than in A1.A2. In that case A1.A3 would be able to override P2. This is obviously broken to me. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de