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 Path: g2news2.google.com!news3.google.com!news.germany.com!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: overriding in private part Date: Thu, 2 Oct 2008 18:17:28 -0500 Organization: Jacob's private Usenet server Message-ID: References: <45b4a4cc-13f5-4175-9061-9c962e32d762@64g2000hsm.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1222989786 923 69.95.181.76 (2 Oct 2008 23:23:06 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 2 Oct 2008 23:23:06 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news2.google.com comp.lang.ada:7929 Date: 2008-10-02T18:17:28-05:00 List-Id: "Maxim Reznik" wrote in message news:45b4a4cc-13f5-4175-9061-9c962e32d762@64g2000hsm.googlegroups.com... ... > Every type in class A1.Base'Class has P2 primitive subprogram, but any > child of A2.Child can't override it, because P2 is hidden by A2.P2. It > seems unnatural to me. > > Errors of such kind are very difficult to find. > > Is there any way to prevent such errors? (Besides keyword > *overriding*) This happened to us frequently when we were building Claw. That's the reason I pushed so hard to add what became the keywords to the language. It's an error that cannot be avoided or detected in Ada 95 (short of avoiding any declarations in private parts, which is nasty). It is very hard to predict what really is going to happen, so the keywords allow telling the compiler what you meant (and then it will complain if it disagrees). If you can't use new Ada features, you are SOL. Sorry. Randy.