diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-24 13:17:44 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-24 13:17:44 -0400 |
| commit | 0609a26f3108148375d4ee2fb3d2d8f9c5756ae7 (patch) | |
| tree | 8efe6e80124bfd4b79db2abf4a3b77b562eb278f /typecheck.c | |
| parent | a56ce0435d5f382bc26b53a51e56d8b52624139e (diff) | |
Fix type promotion for :divided_by() and :scaled_by() metamethods
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 cfd9fa7b..82eecce7 100644 --- a/typecheck.c +++ b/typecheck.c @@ -940,7 +940,7 @@ type_t *get_type(env_t *env, ast_t *ast) (b && b->type->tag == FunctionType && ({ auto fn = Match(b->type, FunctionType); \ (type_eq(fn->ret, ret_t) \ && (fn->args && type_eq(fn->args->type, lhs_t)) \ - && (fn->args->next && can_promote(fn->args->next->type, rhs_t))); })); }) + && (fn->args->next && can_promote(rhs_t, fn->args->next->type))); })); }) // Check for a binop method like plus() etc: switch (binop->op) { case BINOP_MULT: { |
