From 3fbdbc501e7560a28b1ee0004a47ba4afa07eb41 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Thu, 14 Apr 2022 21:01:47 -0500 Subject: [PATCH] bugfix with polymorphic structure parameter types --- src/symres.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/symres.c b/src/symres.c index c4f6659e..3d4f9f29 100644 --- a/src/symres.c +++ b/src/symres.c @@ -191,6 +191,14 @@ static SymresStatus symres_type(AstType** type) { bh_arr_each(AstPolyStructParam, param, pst_node->poly_params) { SYMRES(type, ¶m->type_node); param->type = type_build_from_ast(context.ast_alloc, param->type_node); + if (param->type == NULL) { + if (context.cycle_detected) { + onyx_report_error(param->token->pos, Error_Waiting_On, "Waiting for parameter type to be known."); + return Symres_Error; + } else { + return Symres_Yield_Macro; + } + } } break; } -- 2.25.1