aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-06-10 15:09:04 +0100
committergingerBill <bill@gingerbill.org>2020-06-10 15:09:04 +0100
commite86fde3cb16d2977054aa727c32cd4efcb1bd8a7 (patch)
tree0a6c76afcbecffef255fd2ce6d50758d2f900d36 /src/check_decl.cpp
parent99944f3b02dd8aef610bdc19e31a790939e29cdd (diff)
Fix #648
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 88e7be316..560518df9 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -435,7 +435,11 @@ void check_const_decl(CheckerContext *ctx, Entity *e, Ast *type_expr, Ast *init,
case Addressing_ProcGroup:
GB_ASSERT(operand.proc_group != nullptr);
GB_ASSERT(operand.proc_group->kind == Entity_ProcGroup);
- override_entity_in_scope(e, operand.proc_group);
+ // NOTE(bill, 2020-06-10): It is better to just clone the contents than overriding the entity in the scope
+ // Thank goodness I made entities a tagged union to allow for this implace patching
+ // override_entity_in_scope(e, operand.proc_group);
+ e->kind = Entity_ProcGroup;
+ e->ProcGroup.entities = array_clone(heap_allocator(), operand.proc_group->ProcGroup.entities);
return;
}