From: "Björn Persson" <spam-away@nowhere.nil>
Subject: Re: Why can't I override these functions?
Date: Sun, 09 May 2004 12:38:32 GMT
Date: 2004-05-09T12:38:32+00:00 [thread overview]
Message-ID: <cDpnc.58610$mU6.237546@newsb.telia.net> (raw)
In-Reply-To: <x7vfzabw3sy.fsf@smaug.pushface.org>
Simon Wright wrote:
> 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.
I can't see how that would apply to this case. The only abstract type
declared in a visible part is Intermediate_Definition, and the copmiler
doesn't complain about that one. It complains about
Typed_Parameter_Definition, which is concrete and declared in a private
part.
> 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;
That workaround works for this small example, but when I applied it to
the real library I ran into other problems instead, like "cannot find
body of generic package "Common_Functions"". I give up. I'll have to
live with virtually identical code in at least four places.
--
Björn Persson
jor ers @sv ge.
b n_p son eri nu
next prev parent reply other threads:[~2004-05-09 12:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-07 10:43 Why can't I override these functions? Björn Persson
2004-05-07 17:15 ` Jim Rogers
2004-05-07 18:15 ` Björn Persson
2004-05-07 18:42 ` Georg Bauhaus
2004-05-07 19:38 ` Björn Persson
2004-05-08 6:15 ` Martin Krischik
2004-05-09 12:42 ` Björn Persson
2004-05-08 11:34 ` Simon Wright
2004-05-09 12:38 ` Björn Persson [this message]
2004-05-10 5:43 ` Simon Wright
2004-05-10 11:49 ` Martin Dowie
2004-05-10 12:13 ` Björn Persson
2004-05-13 7:23 ` Björn Persson
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox