From: Brendan Hansen Date: Mon, 3 Jan 2022 05:04:07 +0000 (-0600) Subject: tiny potential bug fix X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=22f4a8761b4b47bfac68ab20d60788823ad6f1a5;p=onyx.git tiny potential bug fix --- diff --git a/src/polymorph.h b/src/polymorph.h index 0dfcfee1..94d8c09d 100644 --- a/src/polymorph.h +++ b/src/polymorph.h @@ -420,13 +420,13 @@ static AstTyped* try_lookup_based_on_partial_function_type(AstPolyProc *pp, AstF AstType *old_return_type = ft->return_type; ft->return_type = (AstType *) &basic_type_void; ft->partial_function_type = type_build_from_ast(context.ast_alloc, (AstType *) ft); + ft->return_type = old_return_type; if (!ft->partial_function_type) { doing_nested_polymorph_lookup = 1; return NULL; } assert(ft->partial_function_type); - ft->return_type = old_return_type; } AstTyped *result = (AstTyped *) polymorphic_proc_lookup(pp, PPLM_By_Function_Type, ft->partial_function_type, pp->token);