Skip to content

Instantly share code, notes, and snippets.

@JeremyGrosser
Created May 25, 2021 23:54
Show Gist options
  • Save JeremyGrosser/622a591867ffffe5f3c16a5cc874723c to your computer and use it in GitHub Desktop.
Save JeremyGrosser/622a591867ffffe5f3c16a5cc874723c to your computer and use it in GitHub Desktop.
Nested generic procedures in Ada
procedure Main is
generic
type A_Type is private;
procedure Outer (A : A_Type);
procedure Outer (A : A_Type) is
generic
type B_Type is private;
procedure Inner (A : A_Type; B : B_Type);
procedure Inner (A : A_Type; B : B_Type) is
begin
null;
end Inner;
procedure Integer_Inner is new Inner (Integer);
begin
Integer_Inner (A, 2);
end Outer;
procedure Integer_Outer is new Outer (Integer);
begin
Integer_Outer (1);
end Main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment