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 X-Google-Thread: 103376,2107bed9c7be998f X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news-in.ntli.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Why can't I override these functions? Date: 08 May 2004 12:34:21 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <7BRmc.58437$mU6.237336@newsb.telia.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1084016331 27663 62.49.19.209 (8 May 2004 11:38:51 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 8 May 2004 11:38:51 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: controlnews3.google.com comp.lang.ada:385 Date: 2004-05-08T12:34:21+01:00 List-Id: The compiler should probably have said something to point you at: AARM 3.9.3(10), For an abstract type declared in a visible part, an abstract primitive subprogram shall not be declared in the private part, unless it is overriding an abstract subprogram implicitly declared in the visible part. For a tagged type declared in a visible part, a primitive function with a controlling result shall not be declared in the private part, unless it is overriding a function implicitly declared in the visible part. Reason: The ``visible part'' could be that of a package or a generic package. This rule is needed because a non-abstract type extension declared outside the package would not know about any abstract primitive subprograms or primitive functions with controlling results declared in the private part, and wouldn't know that they need to be overridden with non-abstract subprograms. The rule applies to a tagged record type or record extension declared in a visible part, just as to a tagged private type or private extension. The rule applies to explicitly and implicitly declared abstract subprograms: In an equivalent place in the Booch Components, I make the subprogram concrete and say function Item_At (C : Container; Index : Positive) return Item_Ptr is begin raise Should_Have_Been_Overridden; return null; end Item_At; -- Simon Wright 100% Ada, no bugs.