Saturday, 15 January 2011

Ada95 Tagged Limited Record giving me error "Completion of nonlimited type cannot be limited" -



Ada95 Tagged Limited Record giving me error "Completion of nonlimited type cannot be limited" -

i have generic binary search tree package, called gen_bst , its' kid created called gen_bst.avl.

when seek compiling code, ada compiler gives me error message saying: "completion of nonlimited type cannot limited" -- mean, , how prepare it?

ignoring body/specification, record declarations:

--gen_bst: --type declarations type node limited private; -- node itself. type root access node; -- pointer node. private --record declaration type node tagged limited record info : data_type; left_child, right_child : root; end record; --gen_bst.avl: type avl_node private; type avl_root access avl_node; private type avl_node new node record height : natural; end record;

when type avl_node new node ..., avl_node inherits various properties node, , 1 of properties limitedness (arm 7.5(3)). public view of avl_node non-limited, total view must too. 1 prepare create public view limited (type avl_node limited private;); alternatively, create total view of node non-limited (type node tagged record ...).

many agree tagged types should limited, wonder why node , avl_node declared publicly? i'd have thought part of implementation.

compiler-errors record ada

No comments:

Post a Comment