comp.lang.ada
 help / color / mirror / Atom feed
From: Ed Falis <efalis@mediaone.net>
Subject: Re: Should the compiler accept this?
Date: Wed, 10 Oct 2001 17:12:14 GMT
Date: 2001-10-10T17:12:14+00:00	[thread overview]
Message-ID: <3BC481C5.C04EBCB1@mediaone.net> (raw)
In-Reply-To: 9q1uah$6ir$1@trog.dera.gov.uk

Stephen Cole wrote:

> The compiler is not complaining about it, but according to the rules of Ada
> and not just what the compiler accepts, should I be defining a function
> Hello() for derived type MyNewRcd2?? Or can I always assume that the Hello()
> defined for type MyNewRcd will actually catch calls to Hello() made with an
> actual MyNewRcd2 type variable passed as a parameter to Add()?

No, because you're deriving MyNewRcd2 from MyNewRcd, which does provide
a concrete version of Hello, and which is inheritied by MyNewRcd2.  If
you'd derived MyNewRcd2 directly from MyRcd, you would have had to
provide a specific concrete Hello for it.

- Ed



  parent reply	other threads:[~2001-10-10 17:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-10 16:57 Should the compiler accept this? Stephen Cole
2001-10-10 17:11 ` Ted Dennison
2001-10-10 17:12 ` Ed Falis [this message]
2001-10-11  8:48 ` Stephen Cole
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox