tiny potential bug fix
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 3 Jan 2022 05:04:07 +0000 (23:04 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 3 Jan 2022 05:04:07 +0000 (23:04 -0600)
src/polymorph.h

index 0dfcfee16c5cbe0c4ee531333a782e0cd1c0491b..94d8c09d99e28c75fa2cd9c9347f68252c95a69e 100644 (file)
@@ -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);