comp.lang.ada
 help / color / mirror / Atom feed
From: "Adam Beneschan" <adam@irvine.com>
Subject: Re: 2 Ada 95/05 language design questions
Date: 16 Feb 2007 10:52:52 -0800
Date: 2007-02-16T10:52:52-08:00	[thread overview]
Message-ID: <1171651972.248409.324390@l53g2000cwa.googlegroups.com> (raw)
In-Reply-To: <1171580374.075519.138610@h3g2000cwc.googlegroups.com>

On Feb 15, 2:59 pm, pnkflyd...@gmail.com wrote:

> You still have to with in the parent tagged types package.

No, I don't think that's correct.  The following program appears to be
legal, and it compiles with GNAT;  the call to A.CW_Op is legal and
refers to the CW_Op defined in pak1, even though pak1 is not visible
and CW_Op isn't implicitly defined (inherited) in pak2 or pak3:

package pak1 is
    type Root is tagged null record;
    procedure CW_Op (X : in out Root'Class);
end pak1;

with pak1;
package pak2 is
    type Child1 is new pak1.Root with null record;
end pak2;

with pak2;
package pak3 is
    type Child2 is new pak2.Child1 with null record;
end pak3;

with pak3;
procedure test is
    A : pak3.Child2;
begin
    A.CW_Op;
end test;

4.1.3 just says about this notation: "The selector_name (i.e. the
subprogram name) shall resolve to denote a view of a subprogram
declared immediately within the declarative region in which an
ancestor of the type T is declared"; there's nothing in there that
says that the ancestor of T, or the subprogram, has to be visible.

So I think Bob was right about "eliminated".

                       -- Adam




  parent reply	other threads:[~2007-02-16 18:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-15 16:21 2 Ada 95/05 language design questions pnkflyd831
2007-02-15 18:33 ` Adam Beneschan
2007-02-15 18:36 ` Dmitry A. Kazakov
2007-02-15 20:35 ` Robert A Duff
2007-02-15 22:59   ` pnkflyd831
2007-02-16  1:51     ` Randy Brukardt
2007-02-16 18:52     ` Adam Beneschan [this message]
2007-02-15 21:51 ` Simon Wright
2007-02-15 23:00 ` pnkflyd831
replies disabled

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