aboutsummaryrefslogtreecommitdiff
path: root/src/checker/decl.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-12-30 15:45:10 +0000
committerGinger Bill <bill@gingerbill.org>2016-12-30 15:45:10 +0000
commit23d32f34e526cfb657a72e5b2dab86d1df765f0f (patch)
tree7998bcf40ca9f581be6296bf4f68c102a5d234c8 /src/checker/decl.c
parentd714bece47ea058e482389452cd428dad9c28fd0 (diff)
Block Expressions and `give`
Diffstat (limited to 'src/checker/decl.c')
-rw-r--r--src/checker/decl.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/checker/decl.c b/src/checker/decl.c
index cc2c48f78..0c4d3f075 100644
--- a/src/checker/decl.c
+++ b/src/checker/decl.c
@@ -92,7 +92,14 @@ void check_init_variables(Checker *c, Entity **lhs, isize lhs_count, AstNodeArra
}
if (rhs_count > 0 && lhs_count != rhs_count) {
- error(lhs[0]->token, "Assignment count mismatch `%td` := `%td`", lhs_count, rhs_count);
+ error(lhs[0]->token, "Assignment count mismatch `%td` = `%td`", lhs_count, rhs_count);
+ }
+
+ if (lhs[0]->kind == Entity_Variable &&
+ lhs[0]->Variable.is_let) {
+ if (lhs_count != rhs_count) {
+ error(lhs[0]->token, "`let` variables must be initialized, `%td` = `%td`", lhs_count, rhs_count);
+ }
}
gb_temp_arena_memory_end(tmp);
@@ -350,6 +357,11 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) {
error_node(pd->body, "A procedure tagged as `#foreign` cannot have a body");
}
+ if (proc_type->Proc.calling_convention != ProcCC_Odin) {
+ error_node(d->proc_decl, "An internal procedure may only have the Odin calling convention");
+ proc_type->Proc.calling_convention = ProcCC_Odin;
+ }
+
d->scope = c->context.scope;
GB_ASSERT(pd->body->kind == AstNode_BlockStmt);