From e2520d817ce6dd3f4d2ef320b6648a7373e3674a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 24 Feb 2024 14:41:59 -0500 Subject: Type constructors are global --- typecheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typecheck.c b/typecheck.c index bcb5afac..eb1f2427 100644 --- a/typecheck.c +++ b/typecheck.c @@ -122,7 +122,7 @@ void bind_statement(env_t *env, ast_t *statement) if (!type) code_err(statement, "I couldn't get this type"); type_t *constructor_t = Type(FunctionType, .args=Match(type, StructType)->fields, .ret=type); - set_binding(env, def->name, new(binding_t, .type=constructor_t)); + Table_str_set(env->globals, def->name, new(binding_t, .type=constructor_t)); break; } case EnumDef: { -- cgit v1.2.3