mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Fixed inplace problem in list_set
This commit is contained in:
parent
9351746952
commit
30b7545da0
2 changed files with 12 additions and 5 deletions
|
@ -1877,6 +1877,8 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
ListSetInPlace => {
|
||||
let (list_symbol, list_layout) = load_symbol_and_layout(env, scope, &args[0]);
|
||||
|
||||
let output_inplace = get_inplace_from_layout(layout);
|
||||
|
||||
list_set(
|
||||
parent,
|
||||
&[
|
||||
|
@ -1886,6 +1888,7 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
],
|
||||
env,
|
||||
InPlace::InPlace,
|
||||
output_inplace,
|
||||
)
|
||||
}
|
||||
ListSet => {
|
||||
|
@ -1897,8 +1900,10 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
(load_symbol_and_layout(env, scope, &args[2])),
|
||||
];
|
||||
|
||||
let in_place = || list_set(parent, arguments, env, InPlace::InPlace);
|
||||
let clone = || list_set(parent, arguments, env, InPlace::Clone);
|
||||
let output_inplace = get_inplace_from_layout(layout);
|
||||
|
||||
let in_place = || list_set(parent, arguments, env, InPlace::InPlace, output_inplace);
|
||||
let clone = || list_set(parent, arguments, env, InPlace::Clone, output_inplace);
|
||||
let empty = || list_symbol;
|
||||
|
||||
maybe_inplace_list(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue