with text_io;
procedure Test_75 is
generic
package pak1 is
type T1 is null record;
end pak1;
generic
with package A is new pak1(<>);
with package B is new pak1(<>);
package pak2 is
procedure p1(x: B.T1);
procedure p1(x: A.T1);
end pak2;
package body pak2 is
procedure p1(x: B.T1) is
begin
text_io.put_line("failed: wrong p1 called");
end p1;
procedure p1(x: A.T1) is
begin
text_io.put_line("passed");
end p1;
x: A.T1;
begin
p1(x);
end pak2;
package new_pak1 is new pak1;
package new_pak2 is new pak2(new_pak1, new_pak1); -- (1)
begin
null;
end Test_75;
The program outputs:
failed: wrong p1 called
It looks like line (1) switched the actual and formal generic
parameters.