From 0609a26f3108148375d4ee2fb3d2d8f9c5756ae7 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 24 Sep 2024 13:17:44 -0400 Subject: Fix type promotion for :divided_by() and :scaled_by() metamethods --- typecheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'typecheck.c') 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: { -- cgit v1.2.3