diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-10-01 17:09:57 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-10-01 17:09:57 +0100 |
| commit | c1e720a49b3dedf5ad8f0b4b2b444bf3f160834f (patch) | |
| tree | 84acc5f822df2d2eea85564d0077f730ae15644d /src/check_decl.cpp | |
| parent | f38c8875b2211ac6112ff7b17e3cbb31a09757fb (diff) | |
`match` to `switch`; Optional semicolons after "import" statements
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 2ef825083..401722148 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -234,7 +234,7 @@ void check_const_decl(Checker *c, Entity *e, AstNode *type_expr, AstNode *init, d->type_expr = d->init_expr; check_type_decl(c, e, d->type_expr, named_type); return; - } break; + } // NOTE(bill): Check to see if the expression it to be aliases #if 1 @@ -446,6 +446,13 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) { error(e->token, "Procedure `main` cannot have a custom calling convention"); } pt->calling_convention = ProcCC_Contextless; + if (d->scope->is_init) { + if (c->info.entry_point != nullptr) { + error(e->token, "Redeclaration of the entry pointer procedure `main`"); + } else { + c->info.entry_point = e; + } + } } if (is_inline && is_no_inline) { |