aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-06-06 15:16:24 +0100
committergingerBill <bill@gingerbill.org>2020-06-06 15:16:24 +0100
commit59a0bbb38512054eb5c6fc83383c3638ed03d1bf (patch)
treebd7f9e00f72a9b0d1c20e6eddd9251e0012e8070 /src/check_decl.cpp
parenta3fa647bfd579e38337cff173a672159d42f7fd6 (diff)
Improve termination rules checking for missing `return`; Make diverging procedure `-> !` be terminators
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 5b343c5cb..88e7be316 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -1,4 +1,3 @@
-bool check_is_terminating(Ast *node);
void check_stmt (CheckerContext *ctx, Ast *node, u32 flags);
// NOTE(bill): 'content_name' is for debugging and error messages
@@ -1257,7 +1256,7 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty
check_stmt_list(ctx, bs->stmts, Stmt_CheckScopeDecls);
if (type->Proc.result_count > 0) {
- if (!check_is_terminating(body)) {
+ if (!check_is_terminating(body, str_lit(""))) {
if (token.kind == Token_Ident) {
error(bs->close, "Missing return statement at the end of the procedure '%.*s'", LIT(token.string));
} else {