comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria (Jon S Anthony)
Subject: Re: Generic children, instances and visibility...
Date: 1997/04/13
Date: 1997-04-13T00:00:00+00:00	[thread overview]
Message-ID: <JSA.97Apr12205923@alexandria> (raw)
In-Reply-To: JSA.97Apr9151107@alexandria


In article <E8IzEL.2L1.0.-s@inmet.camb.inmet.com> stt@houdini.camb.inmet.com (Tucker Taft) writes:

> : > with Parent.Child;
> : > with Inst_Types;
> : > package Parent.PC_Inst is new Parent.Child (Inst_Types.It);
> : > 
> : > gnat says neither case allows visibility:
> 
> : True.  But that may or may not be accurate (though it probably is...)
> 
> Since GNAT does not complain when you compile the generic,
> it should not complain when you compile the instantiation.
> Any error during instantiation is suspicious, given the Ada 95
> generic "contract" model.

OK, thinking about it that way makes a good deal of sense.  What has
me puzzled a bit is the status of the instantiation in the subsystem
hierarchy.  In particular, shouldn't _only_ the above sort of
instantiation (where the instance _is_ a child of Parent) have
visibility to such private fields?  I see your point about the
contract model and that would seem to indicate that the answer to my
question is "no".  But then how does that jibe with the fact that only
children of the parent can see into its private part???


> If there is an error, it must be something that is due to a usage of
> the formal type in the spec of the generic, not the body.  Hence
> this looks like a compiler bug (albeit a subtle one).

I've convinced myself that this is a bug and your comments reinforce
that conviction.  But, in the cases given the formal type is not even
mentioned in the spec - maybe that's the "abnormal" useage???


> : Tucker, Bob, Norman - any comments appreciated.
> 
> See above.

Check.  Thanks,

/Jon
-- 
Jon Anthony
Organon Motives, Inc.
Belmont, MA 02178
617.484.3383
jsa@organon.com





      parent reply	other threads:[~1997-04-13  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-09  0:00 Generic children, instances and visibility Jon S Anthony
1997-04-09  0:00 ` Stephen Leake
1997-04-09  0:00   ` Jon S Anthony
1997-04-12  0:00     ` Tucker Taft
1997-04-13  0:00     ` Jon S Anthony [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