From 1c77d596b28ee45e0234cfa7c5f5679492f2178e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 23 Nov 2025 01:32:48 -0500 Subject: Fix up some type comparisons --- src/compile/assertions.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/compile/assertions.c') diff --git a/src/compile/assertions.c b/src/compile/assertions.c index 5746b21e..34055998 100644 --- a/src/compile/assertions.c +++ b/src/compile/assertions.c @@ -33,7 +33,9 @@ Text_t compile_assertion(env_t *env, ast_t *ast) { type_t *lhs_t = get_type(env, cmp.lhs); type_t *rhs_t = get_type(with_enum_scope(env, lhs_t), cmp.rhs); type_t *operand_t; - if (cmp.lhs->tag == Int && is_numeric_type(rhs_t)) { + if (type_eq(lhs_t, rhs_t)) { + operand_t = lhs_t; + } else if (cmp.lhs->tag == Int && is_numeric_type(rhs_t)) { operand_t = rhs_t; } else if (cmp.rhs->tag == Int && is_numeric_type(lhs_t)) { operand_t = lhs_t; -- cgit v1.2.3