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 X-Google-Thread: 103376,2107bed9c7be998f X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!news-stoc.telia.net!news-stoa.telia.net!telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Persson?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 X-Accept-Language: sv, en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Why can't I override these functions? References: <7BRmc.58437$mU6.237336@newsb.telia.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Message-ID: Date: Sun, 09 May 2004 12:38:32 GMT NNTP-Posting-Host: 217.209.116.179 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1084106312 217.209.116.179 (Sun, 09 May 2004 14:38:32 CEST) NNTP-Posting-Date: Sun, 09 May 2004 14:38:32 CEST Organization: Telia Internet Xref: controlnews3.google.com comp.lang.ada:395 Date: 2004-05-09T12:38:32+00:00 List-Id: Simon Wright wrote: > The compiler should probably have said something to point you at: >=20 > 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. I can't see how that would apply to this case. The only abstract type=20 declared in a visible part is Intermediate_Definition, and the copmiler=20 doesn't complain about that one. It complains about=20 Typed_Parameter_Definition, which is concrete and declared in a private=20 part. > In an equivalent place in the Booch Components, I make the subprogram > concrete and say >=20 > function Item_At (C : Container; Index : Positive) return Item_Ptr i= s > begin > raise Should_Have_Been_Overridden; > return null; > end Item_At; That workaround works for this small example, but when I applied it to=20 the real library I ran into other problems instead, like "cannot find=20 body of generic package "Common_Functions"". I give up. I'll have to=20 live with virtually identical code in at least four places. --=20 Bj=F6rn Persson jor ers @sv ge. b n_p son eri nu