Last active
December 20, 2015 08:19
-
-
Save flyx/6099315 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- compilation unit 1: | |
generic | |
type T is private; | |
package Unit is | |
-- ... | |
end Unit; | |
-- compilation unit 2: | |
generic | |
type T2 is private; | |
package Unit.Child is | |
-- ... | |
end Unit.Child; | |
-- compilation unit 3: | |
with Unit.Child; -- neccessary, but GNAT says it's unreferenced. | |
generic | |
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; | |
begin | |
null; | |
end Test; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment