diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-26 23:02:09 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-26 23:02:09 -0500 |
| commit | 115c75692bab91f62ff07ab3567a29436ab04515 (patch) | |
| tree | c00e40db70cf7b76af68aa7a6a661008d33feeca /compile.c | |
| parent | 8f5a40b9445fa319f4855cba69e7a795de845307 (diff) | |
Better error checking
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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( |
