diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-16 16:01:15 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-16 16:01:15 -0400 |
| commit | 6ccbd79d4db03ed803e828ccd0664895e96f70a8 (patch) | |
| tree | 6b87f41491f60af94987838ca2f806c3a9c70d83 /src | |
| parent | 43f8c072241e162283751c28de18dc4658470d6e (diff) | |
Better error message
Diffstat (limited to 'src')
| -rw-r--r-- | src/compile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compile.c b/src/compile.c index fa4eff27..c03def22 100644 --- a/src/compile.c +++ b/src/compile.c @@ -4133,7 +4133,8 @@ CORD compile_function(env_t *env, CORD name_code, ast_t *ast, CORD *staticdefs) code_err(ast, "This function will always abort before it reaches the end, but it's declared as having a Void return. It should be declared as an Abort return instead."); } else { if (body_type->tag != ReturnType && body_type->tag != AbortType) - code_err(ast, "This function can reach the end without returning a ", type_to_str(ret_t), " value!"); + code_err(ast, "This function looks like it can reach the end without returning a ", type_to_str(ret_t), " value! \n " + "If this is not the case, please add a call to `fail(\"Unreachable\")` at the end of the function to help the compiler out."); } CORD body_code = CORD_all("{\n", compile_inline_block(body_scope, body), "}\n"); |
