diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-15 21:36:29 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-15 21:36:29 +0100 |
| commit | 3fa398ec43ddc6fc40562087fd8ab87dc5292499 (patch) | |
| tree | ef6c5f930890adf2692a6ae5fc1594961447acd1 /src/check_decl.cpp | |
| parent | 1851674b5035527d16e342e9627fcf8e2da9e49e (diff) | |
Add extra check for bodiless procedures
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 2673a4d17..6cb51102a 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -362,6 +362,8 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) { GB_ASSERT(pd->body->kind == AstNode_BlockStmt); check_procedure_later(c, c->curr_ast_file, e->token, d, proc_type, pd->body, pd->tags); + } else if (!is_foreign) { + error(e->token, "Only a foreign procedure cannot have a body"); } if (pt->result_count == 0 && is_require_results) { |