From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1ef593126ef45087 X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Generic children, instances and visibility... Date: 1997/04/13 Message-ID: #1/1 X-Deja-AN: 234426629 Distribution: world References: Organization: PSI Public Usenet Link Newsgroups: comp.lang.ada Date: 1997-04-13T00:00:00+00:00 List-Id: In article 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