diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-25 22:15:30 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-25 22:15:30 +0100 |
| commit | 1ced92be473ef6f1c6aa0058bcf89c4ded684379 (patch) | |
| tree | a111c9aae3b74619b3cf27a2a17ebed0100af7f5 /src/check_decl.cpp | |
| parent | 15dbea6899fd1e918f4ea0dc91045e0dc460657e (diff) | |
Rudimentary para-poly procedures
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 672673faf..602e09a0a 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -307,7 +307,12 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) { return; } - Type *proc_type = make_type_proc(c->allocator, e->scope, NULL, 0, NULL, 0, false, ProcCC_Odin); + Type *proc_type = e->type; + if (d->gen_proc_type != NULL) { + proc_type = d->gen_proc_type; + } else { + proc_type = make_type_proc(c->allocator, e->scope, NULL, 0, NULL, 0, false, ProcCC_Odin); + } e->type = proc_type; ast_node(pd, ProcDecl, d->proc_decl); @@ -575,7 +580,9 @@ void check_proc_body(Checker *c, Token token, DeclInfo *decl, Type *type, AstNod TypeTuple *params = &type->Proc.params->Tuple; for (isize i = 0; i < params->variable_count; i++) { Entity *e = params->variables[i]; - GB_ASSERT(e->kind == Entity_Variable); + if (e->kind != Entity_Variable) { + continue; + } if (!(e->flags & EntityFlag_Using)) { continue; } |