diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 16:32:00 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 16:32:00 -0400 |
| commit | e0223a4c201b42ca35c73bfad84477efc61f06b2 (patch) | |
| tree | 7f83903c19433c67e102a8688c3af02fd63eab0a /typecheck.c | |
| parent | aaac5dff28b2fa4835dd9a3a352f274069a7b432 (diff) | |
Support ^ exponentiation for integers
Diffstat (limited to 'typecheck.c')
| -rw-r--r-- | typecheck.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |
