From 0e14a4b08212e101d4c936d280cf357b9a1ca854 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Wed, 26 Oct 2022 10:25:21 -0500 Subject: [PATCH] bugfix with looping scopes --- compiler/src/symres.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/src/symres.c b/compiler/src/symres.c index 5fdc45f9..f3763353 100644 --- a/compiler/src/symres.c +++ b/compiler/src/symres.c @@ -113,8 +113,9 @@ static SymresStatus symres_struct_type(AstStructType* s_node) { s_node->flags |= Ast_Flag_Comptime; if (s_node->scope) { - // FIX: This is probably wrong for the long term. - s_node->scope->parent = curr_scope; + assert(s_node->entity); + assert(s_node->entity->scope); + s_node->scope->parent = s_node->entity->scope; scope_enter(s_node->scope); } -- 2.25.1