@_infer_type.register(irast.IfElseExpr)
def __infer_ifelse(ir, schema):
    if_expr_type = infer_type(ir.if_expr, schema)
    else_expr_type = infer_type(ir.else_expr, schema)
    result = s_utils.get_class_nearest_common_ancestor([if_expr_type, else_expr_type])
    if (result is None):
        raise ql_errors.EdgeQLError('if/else clauses must be of related types, got: {}/{}'.format(if_expr_type.name, else_expr_type.name), context=ir.if_expr.context)
    return result
@_infer_type.register(irast.IfElseExpr)
def __infer_ifelse(ir, schema):
    if_expr_type = infer_type(ir.if_expr, schema)
    else_expr_type = infer_type(ir.else_expr, schema)
    result = s_utils.get_class_nearest_common_ancestor([if_expr_type, else_expr_type])
    if (result is None):
        raise ql_errors.EdgeQLError('if/else clauses must be of related types, got: {}/{}'.format(if_expr_type.name, else_expr_type.name), context=ir.if_expr.context)
    return result