mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
add other effect functions
This commit is contained in:
parent
539f173472
commit
f1b4d535c6
4 changed files with 38 additions and 18 deletions
|
@ -4749,10 +4749,33 @@ fn reuse_function_symbol<'a>(
|
|||
) -> Stmt<'a> {
|
||||
match procs.partial_procs.get(&original) {
|
||||
None => {
|
||||
// danger: a foreign symbol may not be specialized!
|
||||
debug_assert!(
|
||||
env.home == original.module_id() || original.module_id() == ModuleId::ATTR
|
||||
);
|
||||
let is_imported =
|
||||
!(env.home == original.module_id() || original.module_id() == ModuleId::ATTR);
|
||||
|
||||
match arg_var {
|
||||
Some(arg_var) if is_imported => {
|
||||
let layout = layout_cache
|
||||
.from_var(env.arena, arg_var, env.subs)
|
||||
.expect("creating layout does not fail");
|
||||
|
||||
procs.insert_passed_by_name(
|
||||
env,
|
||||
arg_var,
|
||||
original,
|
||||
layout.clone(),
|
||||
layout_cache,
|
||||
);
|
||||
}
|
||||
_ => {
|
||||
// danger: a foreign symbol may not be specialized!
|
||||
debug_assert!(
|
||||
!is_imported,
|
||||
"symbol {:?} while processing module {:?}",
|
||||
original,
|
||||
(env.home, &arg_var),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue