fix argument order bug for mapWithIndex

This commit is contained in:
Folkert 2021-09-14 22:20:35 +02:00
parent bd7ce52e26
commit 58ee7f0bfc
2 changed files with 16 additions and 2 deletions

View file

@ -589,9 +589,9 @@ fn call_spec(
let index = builder.add_make_tuple(block, &[])?;
let argument = if closure_env_layout.is_none() {
builder.add_make_tuple(block, &[first, index])?
builder.add_make_tuple(block, &[index, first])?
} else {
builder.add_make_tuple(block, &[first, index, closure_env])?
builder.add_make_tuple(block, &[index, first, closure_env])?
};
builder.add_call(block, spec_var, module, name, argument)?;
}