使用嵌套包类型作为类型的私有部分声明

时间:2021-06-06 12:11:02

标签: nested package declaration ada

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

可以使用 NP.T 作为 P.T 的完整声明吗?

1 个答案:

答案 0 :(得分:7)

您可以做的是根据 P.T 声明 NP.T,如下所示。

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;
相关问题