!standard 12.7(4/2) 07-05-17 AI05-0025-1/03 !class binding interpretation 06-11-13 !status ARG Approved 10-0-2 06-11-18 !status work item 06-11-13 !status received 06-11-03 !priority Medium !difficulty Easy !qualifier Omission !subject Missing legality rules for formal_package_association !summary Formal package parts have similar restrictions to generic instances. !question Suppose you declare a generic with two formal subprograms with the same defining name: generic type T1 is private; type T2 is private; with function "=" (Left, Right : T1) return Boolean is <>; with function "=" (Left, Right : T2) return Boolean is <>; package GP1 is ... end GP1; For an instantiation, 12.3(9) says, "If two or more formal subprograms have the same defining name, then named associations are not allowed for the corresponding actuals". The rule in 12.3(9) applies to the generic_associations, but there isn't any similar rule that applies to generic_formal_parameter_selector_name => <> So nothing seems to make it illegal to say generic type T1 is private; type T2 is private; with package The_Pak1 is new GP1 (T1 => T1, T2 => T2, "=" => <>, "=" => <>); package GP2 is ... end GP2; !recommendation (See summary.) !wording Add after 12.7(4): The generic_formal_parameter_selector_name of a formal_package_association shall denote a generic_formal_parameter_declaration of the template. If two or more formal subprograms of the template have the same defining name, then named associations are not allowed for the corresponding actuals. [Note that this insertion will change the number of paragraph 12.7(4.1/2) to 12.7(4.2/3).] !discussion The existing rules (12.3(9-10)) only apply in a generic_association. The Amendment adds some rules to cover selector_name => <>, namely 12.7(4.1/2) covers duplicated parameter associations, and 12.7(3.2/2) covers named before positional. But the two rules in 12.3(9) have no analog in 12.7, and surely we do not want to allow the naming of non-existent parameters, or overloaded selector_names. Thus rules for those two cases have been added. !corrigendum 12.7(4) @dinsa The @i@fa shall denote a generic package (the @i