From: Brendan Hansen Date: Wed, 26 Oct 2022 15:25:21 +0000 (-0500) Subject: bugfix with looping scopes X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=0e14a4b08212e101d4c936d280cf357b9a1ca854;p=onyx.git bugfix with looping scopes --- 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); }