使用嵌套包类型作为类型的私有部分声明
Using nested package type as type's private part declaration
package P is
type T is private;
private
package NP is
type T is null record;
end NP;
end P;
可以使用 NP.T 作为 P.T 的完整声明吗?
您可以根据 NP.T
声明 P.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;
package P is
type T is private;
private
package NP is
type T is null record;
end NP;
end P;
可以使用 NP.T 作为 P.T 的完整声明吗?
您可以根据 NP.T
声明 P.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;