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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: making a son benefit access ton an instanciation of a generic package required as a formal parameter to his father and instanciated by him Date: Mon, 22 Jan 2018 15:52:04 +0000 Organization: A noiseless patient Spider Message-ID: References: <193126c2-f171-43ed-8c7c-00570f1dd4d4@googlegroups.com> <1eb1f57d-36fa-4bf0-8a40-5b32d71e5c28@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="975865909b2e90636fe380644478e94e"; logging-data="3333"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jLXVlXtfFPq06+Q3tOQOOIX5JPJmR4fU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:Qx6kJcYHGPmFcYoqwpwHyNgRUUs= sha1:bEckqoIQR2v43eHqIoQ6bKul6k8= Xref: reader02.eternal-september.org comp.lang.ada:50056 Date: 2018-01-22T15:52:04+00:00 List-Id: "J-P. Rosen" writes: > Right, and there is a good reason. > Assuming exception E is declared in generic package GP1: > > Imagine this: > generic > package P1 is new GP1 (<>); > package P2 is new GP1 (<>); > package GP2 is... end GP2; > > package body GP2 is > ... > begin > exception > when P1.E => -- not allowed by Ada > ... > when P2.E => -- not allowed by Ada > ... > end GP2; > > So far, so good. But then, if you instantiate: > package Inst1 is new GP1; > > package Inst2 is new GP2 (Inst1, Inst1); > > then you would end up with two different handlers for the same > exception (since formals P1 and P2 are actually the same package > Inst1). And This doesn't seem a million miles away from having name clashes caused by use-visibility. Agreed, the _instantiation_ must fail.