comp.lang.ada
 help / color / mirror / Atom feed
From: Gene Ouye <geneo@rational.com>
Subject: Re: Ada95 visibility problem
Date: 1996/02/26
Date: 1996-02-26T00:00:00+00:00	[thread overview]
Message-ID: <NEWTNews.825369958.31303.geneo@medusa.ppp.rational.com> (raw)
In-Reply-To: 4gsrn2$9d0@wdl1.wdl.loral.com


mab@dst17.wdl.loral.com (Mark A Biggar) wrote:
> In article <4gl9on$8o4@hacgate2.hac.com> ddavenpo@redwood.hac.com (Darren C 
Davenport) writes:

   [Darren doesn't know why a generic child unit isn't seeing declarations
    in the parent that should have been made visible by a use clause.]

> >-------------------------------------------------------------------
> >generic
> >package x is
> >  package z is
> >    function c return integer;
> >  end z;
> >  use z;
> >end x;

   [x'body deleted...]

> >generic
> >package x.d is 
> >  function d return integer;
> >end x.d;
> >package body x.d is
> >  function d return integer is begin return c; end d;
> >end x.d;
> >with x;
> >package k is new x;
> >with x.d;
> >package k.l is new k.d;

   [x.d error message deleted...]

> This is a real error, need to either say "z.c" or add a "use z;" to the 
> declarations set of package body x.d before the function body.

Actually, if you look in the declaration of the specification of x,
you'll see the use clause is already there.  That should make all the 
public declarations in x.z (like the function c) visible to all the 
descendants of x.

> >Now, if package x is not generic all is well.  What's the difference?

sounds like a problem with generics...

> If this is true then it is the non-genreic case that is the error
> (and an undetected one at that).

The use clause in the spec should work for the non-generic case as well.

   [...]

> Agreed, but you still have to use dot-selection to access the components
> of a visible package for which you don't have a use clause.

Did you just miss the use clause in x'spec or am I missing something
about the visibility rules?  (which wouldn't be a big surprise...  :-)

Gene Ouye <geneo@rational.com>





      parent reply	other threads:[~1996-02-26  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-02-23  0:00 Ada95 visibility problem Darren C Davenport
     [not found] ` <4gsrn2$9d0@wdl1.wdl.loral.com>
1996-02-26  0:00   ` Gene Ouye [this message]
replies disabled

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