Merge remote-tracking branch 'origin/trunk' into update_zig_09

This commit is contained in:
Folkert 2022-02-18 22:39:44 +01:00
commit 6631845a3c
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
60 changed files with 1597 additions and 1032 deletions

View file

@ -210,6 +210,7 @@ pub fn listMap(
}
}
// List.mapWithIndex : List before, (before, Nat -> after) -> List after
pub fn listMapWithIndex(
list: RocList,
caller: Caller2,
@ -231,7 +232,8 @@ pub fn listMapWithIndex(
}
while (i < size) : (i += 1) {
caller(data, @ptrCast(?[*]u8, &i), source_ptr + (i * old_element_width), target_ptr + (i * new_element_width));
// before, Nat -> after
caller(data, source_ptr + (i * old_element_width), @ptrCast(?[*]u8, &i), target_ptr + (i * new_element_width));
}
return output;