aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 464c22f1..c6e6ddf5 100644
--- a/compile.c
+++ b/compile.c
@@ -846,6 +846,9 @@ CORD compile(env_t *env, ast_t *ast)
auto test = Match(ast, DocTest);
CORD src = heap_strn(test->expr->start, (size_t)(test->expr->end - test->expr->start));
type_t *expr_t = get_type(env, test->expr);
+ if (!expr_t)
+ code_err(test->expr, "I couldn't figure out the type of this expression");
+
if (test->expr->tag == Declare) {
auto decl = Match(test->expr, Declare);
return CORD_asprintf(