Merge branch 'dev' into feature/closures
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 21 Apr 2023 18:34:34 +0000 (13:34 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 21 Apr 2023 18:34:34 +0000 (13:34 -0500)
1  2 
compiler/include/astnodes.h
compiler/src/builtins.c
compiler/src/checker.c
compiler/src/onyx.c
compiler/src/parser.c
compiler/src/utils.c
compiler/src/wasm_emit.c

Simple merge
Simple merge
index 217e3788f0036f2abc3ff331a76015e59f944bdb,2515038a5f563b4344a77216399a856be5ace0f2..6f6c277fee4cd9342f26bfbd9d56fbd44d019c51
@@@ -2572,22 -2531,14 +2561,22 @@@ CheckStatus check_function(AstFunction
          }
      }
  
-     bh_arr_clear(expected_return_type_stack);
-     bh_arr_push(expected_return_type_stack, &func->type->Function.return_type);
+     bh_arr_clear(context.checker.expected_return_type_stack);
+     bh_arr_push(context.checker.expected_return_type_stack, &func->type->Function.return_type);
  
-     inside_for_iterator = 0;
-     if (for_node_stack) bh_arr_clear(for_node_stack);
+     context.checker.inside_for_iterator = 0;
+     if (context.checker.for_node_stack) bh_arr_clear(context.checker.for_node_stack);
  
      if (func->body) {
 -        CheckStatus status = check_block(func->body);
 +        CheckStatus status = Check_Success;
 +        if (func->captures) {
 +            status = check_capture_block(func->captures);
 +        }
 +
 +        if (status == Check_Success) {
 +            status = check_block(func->body);
 +        }
 +
          if (status == Check_Error && func->generated_from && context.cycle_detected == 0)
              ERROR(func->generated_from->pos, "Error in polymorphic procedure generated from this location.");
  
Simple merge
Simple merge
Simple merge
Simple merge