From: Brendan Hansen Date: Fri, 15 Apr 2022 02:01:47 +0000 (-0500) Subject: bugfix with polymorphic structure parameter types X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=3fbdbc501e7560a28b1ee0004a47ba4afa07eb41;p=onyx.git bugfix with polymorphic structure parameter types --- 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; }