Skip to content

Instantly share code, notes, and snippets.

@JeremyGrosser
Created May 25, 2021 23:47
Show Gist options
  • Save JeremyGrosser/9ad1fc362274cbf26e1bf4e735215c41 to your computer and use it in GitHub Desktop.
Save JeremyGrosser/9ad1fc362274cbf26e1bf4e735215c41 to your computer and use it in GitHub Desktop.
Nested generic packages in Ada
package body Generic_Nested is
package body Inner_Nested is
procedure Test (A : A_Type; B : B_Type) is
begin
null;
end Test;
end Inner_Nested;
end Generic_Nested;
generic
type A_Type is private;
package Generic_Nested is
generic
type B_Type is private;
package Inner_Nested is
procedure Test (A : A_Type; B : B_Type);
end Inner_Nested;
end Generic_Nested;
with Generic_Nested;
procedure Main is
package GN is new Generic_Nested (Integer);
package Inner is new GN.Inner_Nested (Integer);
begin
Inner.Test (1, 2);
end Main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment