aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-02-26 23:02:09 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-02-26 23:02:09 -0500
commit115c75692bab91f62ff07ab3567a29436ab04515 (patch)
treec00e40db70cf7b76af68aa7a6a661008d33feeca /compile.c
parent8f5a40b9445fa319f4855cba69e7a795de845307 (diff)
Better error checking
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(