Skip to content

Instantly share code, notes, and snippets.

Last active December 20, 2015 08:19
What would you like to do?
-- compilation unit 1:
type T is private;
package Unit is
-- ...
end Unit;
-- compilation unit 2:
type T2 is private;
package Unit.Child is
-- ...
end Unit.Child;
-- compilation unit 3:
with Unit.Child; -- neccessary, but GNAT says it's unreferenced.
type T2 is private;
package Specialization is
package Base is new Unit (T2);
generic package Child renames Base.Child;
end Specialization;
-- compilation unit 4:
with Specialization;
procedure Test is
package Instance is new Specialization;
package Instance_Child is new Instance.Child;
-- if I didn't rename the generic package, I'd need to do:
-- package Instance_Child is new Instance.Base.Child;
end Test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment