aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-06-14 13:45:01 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-06-14 13:45:01 -0400
commit729d856139567d8ab458f24e10a8e714251deff1 (patch)
tree12364f2534dc8c7416e6aaf44b8bd8485c1c9899
parent6f11f5cbb45ec3252bd52d3e6f54a128bfe44656 (diff)
Better error reporting
-rw-r--r--typecheck.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/typecheck.c b/typecheck.c
index 14dfde11..31fdfc77 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -579,6 +579,7 @@ type_t *get_type(env_t *env, ast_t *ast)
if (fielded_t->tag == ModuleType) {
const char *name = Match(fielded_t, ModuleType)->name;
env_t *module_env = Table$str_get(*env->imports, name);
+ if (!module_env) code_err(access->fielded, "I couldn't find the environment for this module");
return get_type(module_env, WrapAST(ast, Var, access->field));
} else if (fielded_t->tag == TypeInfoType) {
auto info = Match(fielded_t, TypeInfoType);