aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 1c4c33747..a81022d87 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -2572,7 +2572,7 @@ Entity *check_selector(Checker *c, Operand *operand, AstNode *node, Type *type_h
}
check_entity_decl(c, entity, nullptr, nullptr);
- GB_ASSERT(entity->type != nullptr);
+ GB_ASSERT(entity->type != nullptr || entity->kind == Entity_ProcedureGrouping);
if (is_alias) {
// TODO(bill): Which scope do you search for for an alias?
@@ -2592,13 +2592,20 @@ Entity *check_selector(Checker *c, Operand *operand, AstNode *node, Type *type_h
}
+ Entity **procs = nullptr;
+
if (is_overloaded) {
HashKey key = hash_string(entity_name);
- bool skip = false;
-
- Entity **procs = gb_alloc_array(heap_allocator(), Entity *, overload_count);
+ procs = gb_alloc_array(heap_allocator(), Entity *, overload_count);
multi_map_get_all(&import_scope->elements, key, procs);
+ } else if (entity->kind == Entity_ProcedureGrouping) {
+ is_overloaded = true;
+ procs = entity->ProcedureGrouping.entities.data;
+ overload_count = entity->ProcedureGrouping.entities.count;
+ }
+ if (is_overloaded) {
+ bool skip = false;
for (isize i = 0; i < overload_count; i++) {
Type *t = base_type(procs[i]->type);
if (t == t_invalid) {
@@ -2784,6 +2791,10 @@ Entity *check_selector(Checker *c, Operand *operand, AstNode *node, Type *type_h
operand->builtin_id = cast(BuiltinProcId)entity->Builtin.id;
break;
+ case Entity_ProcedureGrouping:
+ entity->type = t_invalid;
+ break;
+
// NOTE(bill): These cases should never be hit but are here for sanity reasons
case Entity_Nil:
operand->mode = Addressing_Value;