From f4b105456ad5f0949800d19acdb3403de26d7678 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 24 Dec 2024 14:15:10 -0500 Subject: [PATCH] Bugfix for ternary expressions --- compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compile.c b/compile.c index 88e2a5d..95b9ba1 100644 --- a/compile.c +++ b/compile.c @@ -3383,7 +3383,7 @@ CORD compile(env_t *env, ast_t *ast) .code=optional_into_nonnone(condition_type, compile(truthy_scope, var)))); } else if (condition->tag == Var) { type_t *condition_type = get_type(env, condition); - condition_code = compile(env, condition); + condition_code = compile_condition(env, condition); if (condition_type->tag == OptionalType) { truthy_scope = fresh_scope(env); set_binding(truthy_scope, Match(condition, Var)->name, @@ -3391,7 +3391,7 @@ CORD compile(env_t *env, ast_t *ast) .code=optional_into_nonnone(condition_type, compile(truthy_scope, condition)))); } } else { - condition_code = compile(env, condition); + condition_code = compile_condition(env, condition); } type_t *true_type = get_type(truthy_scope, if_->body);