syncing; found some more bugs
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 3 Jan 2022 21:57:40 +0000 (15:57 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 3 Jan 2022 21:57:40 +0000 (15:57 -0600)
core/container/iter.onyx
docs/bugs
src/polymorph.h

index fbdedc4f9068ed39a43f3f838504d628e7985e52..60697ad63483e3148b610098cabb59ea651b3100 100644 (file)
@@ -601,7 +601,7 @@ parallel_for :: #match {}
         threads := (cast(^thread.Thread) alloc.from_stack(thread_count * sizeof thread.Thread))[0 .. (thread_count - 1)];
         for^ threads do thread.spawn(it, ^t_data, #solidify thread_function {body=body, T=T, Ctx=Ctx});
 
-        thread_function(body, ^t_data);
+        thread_function(^t_data, body);
 
         for^ threads do thread.join(it);
         dist.close(dist.data);
@@ -612,7 +612,7 @@ parallel_for :: #match {}
         data: ^Ctx;
     }
 
-    thread_function :: ($body: Code, __data: ^Thread_Data($T, $Ctx)) {
+    thread_function :: (__data: ^Thread_Data($T, $Ctx), $body: Code) {
         thread_data := __data.data;
         for #no_close *__data.iter {
             #insert body;
index 6043da5c0e770ba6e185b06edda6991ddfbe2451..10d44f07c6b2b4c4f9ec7fc7b6637ee27ef159bc 100644 (file)
--- a/docs/bugs
+++ b/docs/bugs
@@ -1,6 +1,7 @@
 List of known bugs:
 
-[ ] switch statements should work with any type that supports '=='.
+[ ] partially solidifying procedures messes up poly param indicies, which causes them to
+    not be solved correctly.
 
 [ ] macros cannot use 'use'.
 
@@ -30,6 +31,8 @@ List of known bugs:
         .{ -1, 0 }, .{ -1,  1 }, .{ 0,  1 }, 
     ];
 
+[X] switch statements should work with any type that supports '=='.
+
 [X] I don't know why this doesn't work... It is complaining that it couldn't match
     either of these cases, but if I remove the first, it matches the second. This
     is clearly wrong behavior, but I don't immediately see where the problem is.
index 94cf396bf308bbbc4a5aa6ae157f07f997837ce4..d1ae0ee127e373e9b92887ab89f46f0d284d86f1 100644 (file)
@@ -775,7 +775,7 @@ AstNode* polymorphic_proc_try_solidify(AstPolyProc* pp, bh_arr(AstPolySolution)
         new_pp->token = tkn;
         new_pp->base_func = pp->base_func;
         new_pp->flags = pp->flags;
-        new_pp->poly_params = pp->poly_params;
+        new_pp->poly_params = bh_arr_copy(context.ast_alloc, pp->poly_params);
 
         ensure_polyproc_cache_is_created(pp);
         new_pp->concrete_funcs = pp->concrete_funcs;