From e0223a4c201b42ca35c73bfad84477efc61f06b2 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 13 Aug 2024 16:32:00 -0400 Subject: Support ^ exponentiation for integers --- typecheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'typecheck.c') diff --git a/typecheck.c b/typecheck.c index 3e657dfa..1100aedc 100644 --- a/typecheck.c +++ b/typecheck.c @@ -899,7 +899,7 @@ type_t *get_type(env_t *env, ast_t *ast) break; } case BINOP_POWER: { - if (rhs_t->tag == NumType && binding_works(binop_method_names[binop->op], binop->lhs, lhs_t, rhs_t, lhs_t)) + if ((rhs_t->tag == NumType || rhs_t->tag == IntType) && binding_works(binop_method_names[binop->op], binop->lhs, lhs_t, rhs_t, lhs_t)) return lhs_t; break; } -- cgit v1.2.3