!ASIS Issue #084 !topic Formal package parameters seen as instantiations !reference ASIS 95-15 !from Sergey Rybin 97-10-17 !keywords generic formal package parameters instantiation !discussion Please consider the following example: generic package GP1 is procedure Proc; end GP1; -- GP1's body omitted. generic with package P1 is new GP1 (<>); with package P2 is new GP1 (<>); procedure GP2; procedure GP2 is begin P1.Proc; P2.Proc; end; Now suppose I analyze the procedure GP2 as a template (not an instantiation of it.) The question I have is about the result of Corresponding_Called_Entity on "P1.Proc" (or "P2.Proc"), which I think needs some clarification. My opinion is that it should return a subprogram declaration that is Is_Part_Of_Instance and whose Enclosing_Element is A_Generic_Package_Declaration that is itself part of instance (cf RM 12.7 (4)) and whose Enclosing_Element eventually is the formal package declaration (which is also a kind of instantiation) P1 (resp. P2). Is that right ? If so, I think that Corresponding_Declaration & Corresponding_Body missed A_Formal_Package_Declaration as an appropriate parameter kind, and they should (respectively) return the expanded template spec and expanded template body as described above (like they do for other kind of instantiations.) Note that the problem arises only when analyzing GP2 as a template. When analyzing an instantiation of GP2, Corresponding_Called_Entity gives subprograms declared inside the actual package for P1 (resp P2) (which are themselves instance of GP1.) BTW, Corresponding_Declaration also missed generic_renamings as possible parameters (it has other renaming declarations, and generic declarations, but generic_renamings are new in Ada95.) !resolution Rejected !date 98-01-07 !Notes This issue has been split into two issues. See Issue #086 and Issue #087.