From c941b9a3325228eba404455afea7ccea0da45095 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Sep 2025 17:44:08 -0400 Subject: Fix tests --- src/compile/comparisons.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/compile/comparisons.c') diff --git a/src/compile/comparisons.c b/src/compile/comparisons.c index 0f9a7ddd..ffa04b9d 100644 --- a/src/compile/comparisons.c +++ b/src/compile/comparisons.c @@ -20,20 +20,19 @@ static CONSTFUNC const char *comparison_operator(ast_e tag) { } Text_t compile_comparison(env_t *env, ast_t *ast) { - switch (ast->tag) { case Equals: case NotEquals: { binary_operands_t binop = BINARY_OPERANDS(ast); type_t *lhs_t = get_type(env, binop.lhs); - type_t *rhs_t = get_type(env, binop.rhs); + type_t *rhs_t = get_type(with_enum_scope(env, lhs_t), binop.rhs); type_t *operand_t; if (binop.lhs->tag == Int && is_numeric_type(rhs_t)) { operand_t = rhs_t; } else if (binop.rhs->tag == Int && is_numeric_type(lhs_t)) { operand_t = lhs_t; - } else if (can_compile_to_type(env, binop.rhs, lhs_t)) { + } else if (can_compile_to_type(with_enum_scope(env, lhs_t), binop.rhs, lhs_t)) { operand_t = lhs_t; } else if (can_compile_to_type(env, binop.lhs, rhs_t)) { operand_t = rhs_t; -- cgit v1.2.3