From e86fde3cb16d2977054aa727c32cd4efcb1bd8a7 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 10 Jun 2020 15:09:04 +0100 Subject: Fix #648 --- src/check_decl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/check_decl.cpp') 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; } -- cgit v1.2.3