Handling inheritance in class typing.