使用嵌套包类型作为类型的私有部分声明
package P is
type T is private;
private
package NP is
type T is null record;
end NP;
end P;
可以使用 NP.T 作为 PT 的完整声明吗?
回答
您可以做的是P.T按照NP.T如下所示进行声明。
广告
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;
- Such conversions require no action at run-time and so should not affect performance.