aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-04-25 12:51:04 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-04-25 12:51:04 -0400
commit5910998a19aab5dab2c761aea946cfbb09a37918 (patch)
tree2fe8d5d3188fa2e11a884cc4442b5cf212b2e516 /typecheck.c
parent061ec4fd8f6679f9484d6a7f11d66edd7bc3ef3d (diff)
Don't import "main"
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/typecheck.c b/typecheck.c
index cba6b41c..5f17856e 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -268,11 +268,10 @@ void bind_statement(env_t *env, ast_t *statement)
for (table_t *bindings = module_env->locals; bindings != module_env->globals; bindings = bindings->fallback) {
for (int64_t i = 1; i <= Table$length(*bindings); i++) {
struct {const char *name; binding_t *binding; } *entry = Table$entry(*bindings, i);
- if (entry->name[0] == '_')
+ if (entry->name[0] == '_' || streq(entry->name, "main"))
continue;
if (Table$str_get(*env->locals, entry->name))
code_err(statement, "This module imports a symbol called '%s', which would clobber another variable", entry->name);
- printf("Imported binding: %s\n", entry->name);
Table$str_set(env->locals, entry->name, entry->binding);
}
}
@@ -284,7 +283,6 @@ void bind_statement(env_t *env, ast_t *statement)
continue;
//code_err(statement, "This module imports a type called '%s', which would clobber another type", entry->name);
- printf("Imported type: %s\n", entry->name);
Table$str_set(env->types, entry->name, entry->type);
}
break;