mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
add a todo impl
This commit is contained in:
parent
63db2c0eea
commit
55fa8098d3
1 changed files with 34 additions and 1 deletions
|
@ -8424,7 +8424,40 @@ fn call_by_name<'a>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(RawFunctionLayout::ErasedFunction(..)) => todo_lambda_erasure!(),
|
Ok(RawFunctionLayout::ErasedFunction(arg_layouts, ret_layout)) => {
|
||||||
|
// TODO(erased-lambdas) call-by-name should never apply here
|
||||||
|
let arena = env.arena;
|
||||||
|
let arg_symbols = Vec::from_iter_in(
|
||||||
|
loc_args.iter().map(|(arg_var, arg_expr)| {
|
||||||
|
possible_reuse_symbol_or_specialize(
|
||||||
|
env,
|
||||||
|
procs,
|
||||||
|
layout_cache,
|
||||||
|
&arg_expr.value,
|
||||||
|
*arg_var,
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
arena,
|
||||||
|
)
|
||||||
|
.into_bump_slice();
|
||||||
|
|
||||||
|
let result = erased::call_erased_function(
|
||||||
|
env,
|
||||||
|
layout_cache,
|
||||||
|
procs,
|
||||||
|
roc_can::expr::Expr::Var(proc_name, fn_var),
|
||||||
|
fn_var,
|
||||||
|
(arg_layouts, ret_layout),
|
||||||
|
arg_symbols,
|
||||||
|
assigned,
|
||||||
|
hole,
|
||||||
|
// TODO is this right??
|
||||||
|
ret_layout,
|
||||||
|
);
|
||||||
|
|
||||||
|
let iter = loc_args.into_iter().rev().zip(arg_symbols.iter().rev());
|
||||||
|
assign_to_symbols(env, procs, layout_cache, iter, result)
|
||||||
|
}
|
||||||
Ok(RawFunctionLayout::ZeroArgumentThunk(ret_layout)) => {
|
Ok(RawFunctionLayout::ZeroArgumentThunk(ret_layout)) => {
|
||||||
if procs.is_module_thunk(proc_name) {
|
if procs.is_module_thunk(proc_name) {
|
||||||
// here we turn a call to a module thunk into forcing of that thunk
|
// here we turn a call to a module thunk into forcing of that thunk
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue