diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-01-17 18:47:38 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-01-17 18:47:38 +0000 |
| commit | cb59c1cf0805166d8b3230fea47d8674dacf157a (patch) | |
| tree | 526e381480c5076e8dce90bc4bbfa07253e5e1ea /src/check_stmt.c | |
| parent | 383f5b55ad76d6b670b6ae7e2816cc4d8f0d8731 (diff) | |
Comma for all field separators; Overloaded procedures follow exportation rules
Diffstat (limited to 'src/check_stmt.c')
| -rw-r--r-- | src/check_stmt.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/check_stmt.c b/src/check_stmt.c index e956bff81..b1f2a6d97 100644 --- a/src/check_stmt.c +++ b/src/check_stmt.c @@ -215,14 +215,9 @@ Type *check_assignment_variable(Checker *c, Operand *op_a, AstNode *lhs) { if (op_a->mode == Addressing_Overload) { isize overload_count = op_a->overload_count; - Entity *entity = op_a->initial_overload_entity; - String name = entity->token.string; - Scope *s = entity->scope; - gbTempArenaMemory tmp = gb_temp_arena_memory_begin(&c->tmp_arena); - Entity **procs = gb_alloc_array(c->tmp_allocator, Entity *, overload_count); - - HashKey key = hash_string(name); - map_entity_multi_get_all(&s->elements, key, procs); + Entity **procs = op_a->overload_entities; + GB_ASSERT(procs != NULL && overload_count > 0); + // NOTE(bill): These should be done for (isize i = 0; i < overload_count; i++) { Type *t = base_type(procs[i]->type); @@ -238,15 +233,14 @@ Type *check_assignment_variable(Checker *c, Operand *op_a, AstNode *lhs) { break; } } - gb_temp_arena_memory_end(tmp); if (e != NULL) { + // HACK TODO(bill): Should the entities be freed as it's technically a leak op_a->mode = Addressing_Value; op_a->type = e->type; op_a->overload_count = 0; - op_a->initial_overload_entity = NULL; + op_a->overload_entities = NULL; } - } else { if (node->kind == AstNode_Ident) { ast_node(i, Ident, node); @@ -1085,7 +1079,7 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) { e = scope_lookup_entity(c->context.scope, name); } else if (expr->kind == AstNode_SelectorExpr) { Operand o = {0}; - e = check_selector(c, &o, expr); + e = check_selector(c, &o, expr, NULL); is_selector = true; } |