Having the following package hierarchy:
limited private with Root.Child;
package Root is
type Root_t is tagged private;
procedure p_dispatcher (this : in out Root_t);
private
type ChildWideAcc_t is access Root.Child.Child_t;
type Root_t is tagged
record
ref : ChildWideAcc_t;
end record;
end Root;
private package Root.Child is
type Child_t is abstract tagged private;
procedure p_opExample (
this : in out Child_t;
Context : in out Root.Root_t
);
private
type Child_t is abstract tagged null record;
end Root.Child;
I understand that a child package with's automatically it's parent's spec, and a private child package the private part also, but if I do not write any "use" statement on the child I can write too "Root_t" for the "Context" argument type for the procedure "p_opExample" and my program is running exactly the same, like this:
procedure p_opExample (
this : in out Child_t;
Context : in out Root_t
);
Is this behaviour ok? Why?