From c1e4730f353aa5424a038bfdc39d338ca8a1cb73 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 15 May 2024 13:42:45 -0400 Subject: Fix for bare enums in multi-assigns --- compile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compile.c b/compile.c index 9138b3a8..7692e106 100644 --- a/compile.c +++ b/compile.c @@ -285,8 +285,9 @@ CORD compile_statement(env_t *env, ast_t *ast) int64_t i = 1; for (ast_list_t *target = assign->targets, *value = assign->values; target && value; target = target->next, value = value->next) { type_t *target_type = get_type(env, target->ast); - type_t *value_type = get_type(env, value->ast); - CORD val_code = compile(with_enum_scope(env, target_type), value->ast); + env_t *val_scope = with_enum_scope(env, target_type); + type_t *value_type = get_type(val_scope, value->ast); + CORD val_code = compile(val_scope, value->ast); if (!promote(env, &val_code, value_type, target_type)) code_err(value->ast, "This %T value cannot be converted to a %T type", value_type, target_type); CORD_appendf(&code, "%r $%ld = %r;\n", compile_type(env, target_type), i++, val_code); -- cgit v1.2.3