We need a form of virtual inheritence:
class Writer : *Object, VTableBase {
uint write(String data) { die('not implemented'); }
}
Use of the "*Object" notation indidates that Writer has Object as a virtual
base class. This effectively renders Writer abstract - it can not be directly
instantiated, you have to derive from it by a class that is also
(non-virtually) derived from Object.
Given a Writer object, we can:
- upcast to object (a special function will be added to the vtable to be
implemented by the derived class which will do the upcast given its concrete
inheritence on Object)
- call any Object methods and access any Object attributes (by implicitly
upcasting)
Original issue reported on code.google.com by mind...@gmail.com on 8 Sep 2010 at 2:39
Original issue reported on code.google.com by
mind...@gmail.com
on 8 Sep 2010 at 2:39