diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-25 22:29:23 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-25 22:29:23 +0100 |
| commit | 4e7150b470fe9a0b0794fa9bdbac49ffc2c113be (patch) | |
| tree | e55b17877f267e8d84410554bacb75ea0255d196 /src/check_expr.cpp | |
| parent | 1ced92be473ef6f1c6aa0058bcf89c4ded684379 (diff) | |
Allow nested para-poly procedures
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index f61809078..460c449da 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -5075,6 +5075,27 @@ CALL_ARGUMENT_CHECKER(check_call_arguments_internal) { add_entity_use(c, ce->proc, gen_entity); check_procedure_later(c, c->curr_ast_file, token, d, final_proc_type, pd->body, tags); + + + auto *found = map_get(&c->info.gen_procs, hash_pointer(entity->identifier)); + if (found) { + bool ok = true; + for_array(i, *found) { + Entity *other = (*found)[i]; + if (are_types_identical(other->type, gen_entity->type)) { + ok = false; + break; + } + } + if (ok) { + array_add(found, gen_entity); + } + } else { + Array<Entity *> array = {}; + array_init(&array, heap_allocator()); + array_add(&array, gen_entity); + map_set(&c->info.gen_procs, hash_pointer(entity->identifier), array); + } } |