wip #28: Add CodeGuard::checkTypeAndThrow(...).