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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!64g2000hsm.googlegroups.com!not-for-mail From: Maxim Reznik Newsgroups: comp.lang.ada Subject: overriding in private part Date: Thu, 2 Oct 2008 08:49:10 -0700 (PDT) Organization: http://groups.google.com Message-ID: <45b4a4cc-13f5-4175-9061-9c962e32d762@64g2000hsm.googlegroups.com> NNTP-Posting-Host: 91.124.247.142 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1222962551 19644 127.0.0.1 (2 Oct 2008 15:49:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 2 Oct 2008 15:49:11 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 64g2000hsm.googlegroups.com; posting-host=91.124.247.142; posting-account=K1cP1QoAAAD_GR6kW2Td0NqGqGBLRE8h User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; ru; rv:1.8.1.11) Gecko/20080116 Firefox/2.0.0.11,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2196 Date: 2008-10-02T08:49:10-07:00 List-Id: Hi all Trying to find memory leak in AWS I found strange bug. Let my explain by example: http://pastebin.mozilla-russia.org/92280 There is a package hierarchy of three packages: A1, A1.A2 and A1.A3. And type hierarchy: A1.Base, A2.Child derived from A1.Base, A3.Child derived from A2.Child. A1.Base has primitive procedure P2 in private part of A1. A2.Child override P2 with its own P2 in private part of A2. A3.Child is expected to override P2 with its own P2 in private part of A3, but actually it can't! As result A3.P2 is never called in this example. (And never free memory in AWS) My expectation about this code, that A3.P2 override A1.P2 because private part of A1 is visible at this place, and A2.P2 invisible here, so have no influence here. But A2.P2 hides A1.P2 indeed. 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*) -- Maxim Reznik