mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-10 18:08:55 +03:00
wasm: Explicit exhaustiveness on conditionals for higher-order lowlevels
This commit is contained in:
parent
a6faf875f8
commit
c32ce44b29
@ -2033,7 +2033,10 @@ pub fn call_higher_order_lowlevel<'a>(
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
match op {
|
match op {
|
||||||
ListSortWith { .. } => ProcSource::HigherOrderCompare(passed_proc_index),
|
ListSortWith { .. } => ProcSource::HigherOrderCompare(passed_proc_index),
|
||||||
_ => ProcSource::HigherOrderMapper(passed_proc_index),
|
ListMap { .. } | ListMap2 { .. } | ListMap3 { .. } | ListMap4 { .. } => {
|
||||||
|
ProcSource::HigherOrderMapper(passed_proc_index)
|
||||||
|
}
|
||||||
|
DictWalk { .. } => todo!("DictWalk"),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let wrapper_sym = backend.create_symbol(&format!("#wrap#{:?}", fn_name));
|
let wrapper_sym = backend.create_symbol(&format!("#wrap#{:?}", fn_name));
|
||||||
@ -2055,19 +2058,23 @@ pub fn call_higher_order_lowlevel<'a>(
|
|||||||
.map(Layout::Boxed),
|
.map(Layout::Boxed),
|
||||||
);
|
);
|
||||||
|
|
||||||
if let ProcSource::HigherOrderMapper(_) = helper_proc_source {
|
match helper_proc_source {
|
||||||
// Our convention for mappers is that they write to the heap via the last argument
|
ProcSource::HigherOrderMapper(_) => {
|
||||||
wrapper_arg_layouts.push(Layout::Boxed(result_layout));
|
// Our convention for mappers is that they write to the heap via the last argument
|
||||||
ProcLayout {
|
wrapper_arg_layouts.push(Layout::Boxed(result_layout));
|
||||||
arguments: wrapper_arg_layouts.into_bump_slice(),
|
ProcLayout {
|
||||||
result: Layout::UNIT,
|
arguments: wrapper_arg_layouts.into_bump_slice(),
|
||||||
captures_niche: fn_name.captures_niche(),
|
result: Layout::UNIT,
|
||||||
|
captures_niche: fn_name.captures_niche(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
ProcSource::HigherOrderCompare(_) => ProcLayout {
|
||||||
ProcLayout {
|
|
||||||
arguments: wrapper_arg_layouts.into_bump_slice(),
|
arguments: wrapper_arg_layouts.into_bump_slice(),
|
||||||
result: *result_layout,
|
result: *result_layout,
|
||||||
captures_niche: fn_name.captures_niche(),
|
captures_niche: fn_name.captures_niche(),
|
||||||
|
},
|
||||||
|
ProcSource::Roc | ProcSource::Helper => {
|
||||||
|
internal_error!("Should never reach here for {:?}", helper_proc_source)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user