From aa6992613087f227df8f823e8ee41761c386840e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 2 May 2025 22:47:19 -0400 Subject: Bugfix for integer math between Int and fixed-width int, where Int was the second operand --- src/compile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/compile.c') diff --git a/src/compile.c b/src/compile.c index 02d4795c..6dd10a20 100644 --- a/src/compile.c +++ b/src/compile.c @@ -580,6 +580,7 @@ static CORD compile_binary_op(env_t *env, ast_t *ast) type_t *overall_t = get_type(env, ast); binding_t *b = get_metamethod_binding(env, ast->tag, binop.lhs, binop.rhs, overall_t); + if (!b) b = get_metamethod_binding(env, ast->tag, binop.rhs, binop.lhs, overall_t); if (b) { arg_ast_t *args = new(arg_ast_t, .value=binop.lhs, .next=new(arg_ast_t, .value=binop.rhs)); DeclareMatch(fn, b->type, FunctionType); -- cgit v1.2.3