Oh no the big guy(Delphi) is BROKEN too, how sad.
I just figure it out this is as a matter of package/unit visibility, since C++ is only know straightforward name collision solver namespaces.Code:interface type TNode = class protected fTest :String; public property Test: String read fTest; end; TLinkedNode = class(TNode) public procedure Test(Node: TNode); end; implementation procedure TLinkedNode.Test(Node: TNode); begin Node.fTest := 'Hello world!'; end; end. var Node : TNode; Linked: TLinkedNode; begin Node := TNode.Create; Linked := TLinkedNode.Create; Linked.Test(Node); Writeln(Node.Test); end;
However the problem can be solved in nasty way(which maybe possible in C++): If and if only there is an ability to access parameter's base class to call the non-overriden method -- IF the parameter IS LinkedNode, otherwise we don't care.
Sorry, I will just giving you my simplified abstract problem. I usually use Stack, Node, LinkedList, Point or Rectangles which in reality much much overcomplicated :P