diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-12-24 14:15:10 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-12-24 14:15:10 -0500 |
| commit | f4b105456ad5f0949800d19acdb3403de26d7678 (patch) | |
| tree | 3f0d9d46b187f36827fe07b1f4c9320c9531b0b1 | |
| parent | add1da2a964cab83818209c99c9b514659036626 (diff) | |
Bugfix for ternary expressions
| -rw-r--r-- | compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |
