aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-05-23 13:38:06 +0100
committergingerBill <bill@gingerbill.org>2020-05-23 13:38:06 +0100
commitaa029fe8d9d48477f0be27fa79f8c541451a8a0a (patch)
treeb15ec4c1364b527ac6337385b31998326ab85605 /src/check_decl.cpp
parentef539696b9540cc45a4343f0fecdb4bbcb1a8a0e (diff)
Add `"pure"` procedure types
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index f629a0903..5b343c5cb 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -1174,11 +1174,14 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty
CheckerContext new_ctx = *ctx_;
CheckerContext *ctx = &new_ctx;
+ GB_ASSERT(type->kind == Type_Proc);
+
ctx->scope = decl->scope;
ctx->decl = decl;
ctx->proc_name = proc_name;
ctx->curr_proc_decl = decl;
ctx->curr_proc_sig = type;
+ ctx->curr_proc_calling_convention = type->Proc.calling_convention;
ast_node(bs, BlockStmt, body);
@@ -1187,7 +1190,6 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty
defer (array_free(&using_entities));
{
- GB_ASSERT(type->kind == Type_Proc);
if (type->Proc.param_count > 0) {
TypeTuple *params = &type->Proc.params->Tuple;
for_array(i, params->variables) {
@@ -1242,7 +1244,7 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty
// NOTE(bill, 2019-08-31): Don't check the body as the where clauses failed
return;
}
-
+
check_open_scope(ctx, body);
{
for_array(i, using_entities) {