diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-26 11:57:26 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-26 11:57:26 +0100 |
| commit | c642e326cecd3dc33ca5a9efb6330e757c378dd9 (patch) | |
| tree | c8bd1554fa2fc9e9d31012d4e98261755a7ced3a /src/checker.cpp | |
| parent | 362a11878283eea69cf5a18b7f05c964643a7a64 (diff) | |
Undef value `---` (for setting a value to be uninitialized/undefined)
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 5f5b8a281..5576180a4 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1168,6 +1168,9 @@ void add_type_info_type(Checker *c, Type *t) { } } +void check_procedure_later(Checker *c, ProcedureInfo info) { + map_set(&c->procs, hash_decl_info(info.decl), info); +} void check_procedure_later(Checker *c, AstFile *file, Token token, DeclInfo *decl, Type *type, AstNode *body, u64 tags) { ProcedureInfo info = {}; @@ -1177,7 +1180,7 @@ void check_procedure_later(Checker *c, AstFile *file, Token token, DeclInfo *dec info.type = type; info.body = body; info.tags = tags; - map_set(&c->procs, hash_decl_info(decl), info); + check_procedure_later(c, info); } void push_procedure(Checker *c, Type *type) { @@ -2252,6 +2255,9 @@ void check_parsed_files(Checker *c) { // NOTE(bill): Nested procedures bodies will be added to this "queue" for_array(i, c->procs.entries) { ProcedureInfo *pi = &c->procs.entries[i].value; + if (pi->type == NULL) { + continue; + } CheckerContext prev_context = c->context; defer (c->context = prev_context); |