spec for List.reverse

This commit is contained in:
Folkert 2021-10-03 13:34:09 +02:00
parent 13d480d5f3
commit 0690633116
4 changed files with 16 additions and 3 deletions

View file

@ -4930,7 +4930,7 @@ fn run_low_level<'a, 'ctx, 'env>(
let (list, list_layout) = load_symbol_and_layout(scope, &args[0]);
list_reverse(env, list, list_layout)
list_reverse(env, list, list_layout, update_mode)
}
ListConcat => {
debug_assert_eq!(args.len(), 2);

View file

@ -172,6 +172,7 @@ pub fn list_reverse<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>,
list: BasicValueEnum<'ctx>,
list_layout: &Layout<'a>,
update_mode: UpdateMode,
) -> BasicValueEnum<'ctx> {
let element_layout = match *list_layout {
Layout::Builtin(Builtin::EmptyList) => {
@ -190,6 +191,7 @@ pub fn list_reverse<'a, 'ctx, 'env>(
pass_list_cc(env, list),
env.alignment_intvalue(&element_layout),
layout_width(env, &element_layout),
pass_update_mode(env, update_mode),
],
bitcode::LIST_REVERSE,
)