mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-01 02:42:17 +00:00
Compile higher-order low-level calls that take functions with no closure args
Closes #3571
This commit is contained in:
parent
7b9b855dcc
commit
2cdb951752
3 changed files with 47 additions and 14 deletions
|
@ -433,14 +433,15 @@ fn build_transform_caller_help<'a, 'ctx, 'env>(
|
|||
arguments_cast.push(argument);
|
||||
}
|
||||
|
||||
match closure_data_layout.runtime_representation() {
|
||||
Layout::Struct {
|
||||
field_layouts: &[], ..
|
||||
} => {
|
||||
// nothing to add
|
||||
match (
|
||||
closure_data_layout.is_represented().is_some(),
|
||||
closure_data_layout.runtime_representation(),
|
||||
) {
|
||||
(false, _) => {
|
||||
// the function doesn't expect a closure argument, nothing to add
|
||||
}
|
||||
other => {
|
||||
let closure_type = basic_type_from_layout(env, &other).ptr_type(AddressSpace::Generic);
|
||||
(true, layout) => {
|
||||
let closure_type = basic_type_from_layout(env, &layout).ptr_type(AddressSpace::Generic);
|
||||
|
||||
let closure_cast = env
|
||||
.builder
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue