def infer_type(ir, schema):
    try:
        return ir._inferred_type_
    except AttributeError:
        pass
    result = _infer_type(ir, schema)
    if ((result is not None) and (not isinstance(result, (s_obj.Object, s_obj.ObjectMeta)))):
        raise ql_errors.EdgeQLError(f'infer_type({ir!r}) retured {result!r} instead of a Object', context=ir.context)
    if ((result is None) or (result.name == 'std::any')):
        raise ql_errors.EdgeQLError('could not determine expression type', context=ir.context)
    ir._inferred_type_ = result
    return result
def infer_type(ir, schema):
    try:
        return ir._inferred_type_
    except AttributeError:
        pass
    result = _infer_type(ir, schema)
    if ((result is not None) and (not isinstance(result, (s_obj.Object, s_obj.ObjectMeta)))):
        raise ql_errors.EdgeQLError(f'infer_type({ir!r}) retured {result!r} instead of a Object', context=ir.context)
    if ((result is None) or (result.name == 'std::any')):
        raise ql_errors.EdgeQLError('could not determine expression type', context=ir.context)
    ir._inferred_type_ = result
    return result