mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
fix import of top-level thunks
This commit is contained in:
parent
3d827f40f4
commit
05a6b30644
4 changed files with 11 additions and 4 deletions
|
@ -4758,6 +4758,8 @@ fn reuse_function_symbol<'a>(
|
|||
.from_var(env.arena, arg_var, env.subs)
|
||||
.expect("creating layout does not fail");
|
||||
|
||||
add_needed_external(procs, env, arg_var, original);
|
||||
|
||||
procs.insert_passed_by_name(
|
||||
env,
|
||||
arg_var,
|
||||
|
@ -4765,6 +4767,11 @@ fn reuse_function_symbol<'a>(
|
|||
layout.clone(),
|
||||
layout_cache,
|
||||
);
|
||||
|
||||
// an imported symbol is always a function pointer:
|
||||
// either it's a function, or a top-level 0-argument thunk
|
||||
let expr = Expr::FunctionPointer(original, layout.clone());
|
||||
return Stmt::Let(original, expr, layout, env.arena.alloc(result));
|
||||
}
|
||||
_ => {
|
||||
// danger: a foreign symbol may not be specialized!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue