Using nested package type as type's private part declaration

Viewed 76
package P is
   type T is private;
private
   package NP is
      type T is null record;
   end NP;
end P;

It is possible to use NP.T as full declaration of P.T?

1 Answers

What you can do is declare P.T in terms of NP.T as shown below.

p.ads

package P is
   
   type T is private;
   
private
   
   package NP is
      type T is null record;
   end NP;
   
   type T is new NP.T;
   
end P;
Related