From: Brendan Hansen Date: Mon, 3 Jan 2022 21:57:40 +0000 (-0600) Subject: syncing; found some more bugs X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=4f20c58143ae7dca29182b56584e55dfb59e083c;p=onyx.git syncing; found some more bugs --- diff --git a/core/container/iter.onyx b/core/container/iter.onyx index fbdedc4f..60697ad6 100644 --- a/core/container/iter.onyx +++ b/core/container/iter.onyx @@ -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; diff --git a/docs/bugs b/docs/bugs index 6043da5c..10d44f07 100644 --- 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. diff --git a/src/polymorph.h b/src/polymorph.h index 94cf396b..d1ae0ee1 100644 --- a/src/polymorph.h +++ b/src/polymorph.h @@ -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;