我有一个记录,想要一些访问器功能。
package Some_Package is
type A is tagged record
First_Field : Integer;
Second_Field : Character;
end record;
type B is private;
function Some_A (Some_B : B) return A;
private
type B is tagged record
Some_A : A;
end record;
end Some_Package;
这是 GNAT 给我的:
some_package.ads:10:13: operation can be dispatching in only one type
这个错误对于 Ada 新手来说有点神秘,我希望能得到一些解释我做错了什么以及如何正确地做。