def _infer_binop_args(left, right, schema):
    if ((not isinstance(left, irast.EmptySet)) or (left.scls is not None)):
        left_type = infer_type(left, schema)
    else:
        left_type = None
    if ((not isinstance(right, irast.EmptySet)) or (right.scls is not None)):
        right_type = infer_type(right, schema)
    else:
        right_type = None
    if ((left_type is None) and (right_type is None)):
        raise ql_errors.EdgeQLError('cannot determine the type of an empty set', context=left.context)
    elif (left_type is None):
        amend_empty_set_type(left, right_type, schema)
        left_type = right_type
    elif (right_type is None):
        amend_empty_set_type(right, left_type, schema)
        right_type = left_type
    return (left_type, right_type)
def _infer_binop_args(left, right, schema):
    if ((not isinstance(left, irast.EmptySet)) or (left.scls is not None)):
        left_type = infer_type(left, schema)
    else:
        left_type = None
    if ((not isinstance(right, irast.EmptySet)) or (right.scls is not None)):
        right_type = infer_type(right, schema)
    else:
        right_type = None
    if ((left_type is None) and (right_type is None)):
        raise ql_errors.EdgeQLError('cannot determine the type of an empty set', context=left.context)
    elif (left_type is None):
        amend_empty_set_type(left, right_type, schema)
        left_type = right_type
    elif (right_type is None):
        amend_empty_set_type(right, left_type, schema)
        right_type = left_type
    return (left_type, right_type)