aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-09-10 15:00:19 +0100
committergingerBill <bill@gingerbill.org>2020-09-10 15:00:19 +0100
commitc1149dbdeea1803267acd50c97a0070304b1b0c3 (patch)
tree54576c90361640b44dd6bcb643cf71f226aee478 /src/check_decl.cpp
parent7e625f6ee71e48a01137ac3e918b747b29cf681e (diff)
Update math and math/linalg; add "pure_none" calling convention
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index f05c7cd24..c8070598b 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -1197,6 +1197,15 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty
ctx->curr_proc_sig = type;
ctx->curr_proc_calling_convention = type->Proc.calling_convention;
+ switch (type->Proc.calling_convention) {
+ case ProcCC_None:
+ error(body, "Procedures with the calling convention \"none\" are not allowed a body");
+ break;
+ case ProcCC_PureNone:
+ error(body, "Procedures with the calling convention \"pure_none\" are not allowed a body");
+ break;
+ }
+
ast_node(bs, BlockStmt, body);
Array<ProcUsingVar> using_entities = {};