From 6ccbd79d4db03ed803e828ccd0664895e96f70a8 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 16 Apr 2025 16:01:15 -0400 Subject: Better error message --- src/compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/compile.c') 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"); -- cgit v1.2.3