I'm creating a class that inherits from a parent class with protected instantiation. The super class has a static method that provides an instance of the class.
The following code causes a run-time error MOVE_CAST_ERROR
:
data: o_child type ref to zchild.
o_child ?= zparent=>provide_instance( ).
I have also tried:
data: o_parent type ref to zparent,
o_child type ref to zchild.
o_parent = zparent=>provide_instance( ).
o_child ?= o_parent.
I have succesfully down-casted with other object types in the past - does anyone have an idea what to look for in ZPARENT or ZCHILD that may make the two classes incompatible?
Currently ZCHILD only has one extra method, which if added to the super class would break the abstraction of the class, so I'm not that keen to do it.