diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-24 14:41:59 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-24 14:41:59 -0500 |
| commit | e2520d817ce6dd3f4d2ef320b6648a7373e3674a (patch) | |
| tree | 237838bd6a948c463fa8813cd60e8f1aaf69978b /typecheck.c | |
| parent | 08d1a6b971e00055b5a6085c50543059b87290bc (diff) | |
Type constructors are global
Diffstat (limited to 'typecheck.c')
| -rw-r--r-- | typecheck.c | 2 |
1 files changed, 1 insertions, 1 deletions
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: { |
