Hi,
I managed to implement a generic parent class and create a generic unit,
which is a child of the first one. I wonder, why I have access to
procedures and functions of the parent class, if I am "within" the child
unit, but if I am "outside", the compiler complains that no selector for
a specified function exists.
-- generic parent
generic
type Modular_Type is mod <>;
package Generic_Parent is
type Object is abstract tagged limited null record;
function Example return Integer;
end Generic_Parent;
-- child unit
generic
-- omitted
package Generic_Child is
type Object is new Generic_Parent.Object with private;
function Example return Integer;
end Generic_Child;
-- testsuite
package Parent is new Generic_Parent (2**16);
package Child is new Parent.Object;
-- compiler error, no selector for ...
A : Integer := Child.Example;
My aim is to append some generic childs to a container and iterate
over each item and call a common procedure or function.
Best regards,
Dennis Hoppe


|