From 118efd5ee61c20db8e41df3c340e090148f0dfcb Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Fri, 30 Sep 2022 23:16:13 -0500 Subject: [PATCH] bugfix with resolving C in A(B.C) with injection --- compiler/src/symres.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; } -- 2.25.1