!standard 08.03(26/1) 04-08-31 AI95-00377/01 !class binding interpretation 04-04-20 !status work item 04-08-31 !status received 04-03-23 !priority Low !difficulty Medium !subject Naming of generic child packages !summary If a library unit generic and a library unit instance thereof have child units with the same name, then the explicitly declared child of the instance hides the implicit declaration corresponding to the child of the generic. !question If a library unit generic and a library unit instance thereof have child units with the same name (see the example), then it would seem that the instance declares nonoverloadable homographs. Was this intended? (No.) !recommendation (See summary.) !wording Append to end of 10.1.1(19): Furthermore, if the instance is a library package, then this declaration is not visible within the scope of a with_clause that mentions a child unit of the instance which is a homograph of this declaration. !discussion This scenario never occurs in practice. The language needs to be well-defined and a solution should be chosen which is easy to specify and to implement, but users really don't care about this one at all. We do not want to allow a view of an instance which declares non-overloadable homographs (see, for example, the first sentence of 8.3(26/1)). It seems at least possible that this might requires a bunch of special-case visibility rules, and that is reason enough to abandon this approach. Another approach would be to say that neither of the two declarations are visible, but the suggested solution seems simpler. In addition, the suggested solution is consistent with Ada's notion that in general an explicit declaration hides an implicitly declared homograph. In the wording section, should "is not visible" be replaced with "is hidden from all visibility"? !example generic package G1 is end G1; generic package G1.G2 is end G1.G2; with G1; package I1 is new G1; package Some_Package is end Some_Package; with Some_Package; package I1.G2 renames Some_Package; with G1.G2; with I1.G2; package Q1 renames I1.G2; -- legal? (yes) with G1.G2; with I1.G2; package Q2 is new I1.G2; -- legal? (no) with G1.G2; with I1.G2; with System; procedure Q3 (X : System.Address := I1.G2'Address); -- legal? (yes) --!corrigendum !ACATS test !appendix From: Stephen W. Baird Sent: Tuesday, March 23, 2004 12:34 AM Consider the following example: generic package G1 is end G1; generic package G1.G2 is end G1.G2; with G1; package I1 is new G1; with G1; package I1.G2 renames Standard; with G1.G2; with I1.G2; package Q1 renames I1.G2; -- legal? with G1.G2; with I1.G2; package Q2 is new I1.G2; -- legal? with G1.G2; with I1.G2; with System; procedure Q3 (X : System.Address := I1.G2'Address); -- legal? Should Q1, Q2, and Q3 be rejected? It seems to me that they should, but RM justification for this position is not obvious. In particular, the two "I1.G2" declarations, one a generic package and one a non-generic package rename, do not appear to be hidden from all visibility at the points where the name is used. One might argue that withing both G1.G2 and I1.G2 implicitly results in a view of package I1 which violates the first sentence of 8.3(26/1), but that seems like a stretch. ****************************************************************