From: Brendan Hansen Date: Sat, 1 Oct 2022 04:16:13 +0000 (-0500) Subject: bugfix with resolving C in A(B.C) with injection X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=118efd5ee61c20db8e41df3c340e090148f0dfcb;p=onyx.git bugfix with resolving C in A(B.C) with injection --- diff --git a/compiler/src/symres.c b/compiler/src/symres.c index 1fc9c4e5..5fdc45f9 100644 --- a/compiler/src/symres.c +++ b/compiler/src/symres.c @@ -313,7 +313,11 @@ static SymresStatus symres_field_access(AstFieldAccess** fa) { b32 force_a_lookup = 0; - if (expr->kind == Ast_Kind_Enum_Type || expr->kind == Ast_Kind_Type_Raw_Alias) { + if (expr->kind == Ast_Kind_Struct_Type || + expr->kind == Ast_Kind_Poly_Struct_Type || + expr->kind == Ast_Kind_Enum_Type || + expr->kind == Ast_Kind_Type_Raw_Alias) { + force_a_lookup = 1; } @@ -905,19 +909,25 @@ static SymresStatus symres_directive_defined(AstDirectiveDefined** pdefined) { b32 has_to_be_resolved = context.cycle_almost_detected; + onyx_errors_disable(); resolved_a_symbol = 0; SymresStatus ss = symres_expression(&defined->expr); if (has_to_be_resolved && ss != Symres_Success && !resolved_a_symbol) { // The symbol definitely was not found and there is no chance that it could be found. defined->is_defined = 0; + + onyx_errors_enable(); return Symres_Success; } if (ss == Symres_Success) { defined->is_defined = 1; + + onyx_errors_enable(); return Symres_Success; } + onyx_errors_enable(); return Symres_Yield_Macro; }