mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
simplify information passed to mono
This commit is contained in:
parent
e549ea78fe
commit
126c3f1536
4 changed files with 24 additions and 22 deletions
|
@ -5640,6 +5640,15 @@ fn build_pending_specializations<'a>(
|
|||
|
||||
let layout_cache_snapshot = layout_cache.snapshot();
|
||||
|
||||
let get_host_annotation = |declarations: &Declarations, index: usize| {
|
||||
declarations
|
||||
.host_exposed_annotations
|
||||
.get(&index)
|
||||
.map(|(v, _)| v)
|
||||
.copied()
|
||||
.expect("toplevel definitions have an annotation")
|
||||
};
|
||||
|
||||
// Add modules' decls to Procs
|
||||
for index in 0..declarations.len() {
|
||||
use roc_can::expr::DeclarationTag::*;
|
||||
|
@ -5685,7 +5694,7 @@ fn build_pending_specializations<'a>(
|
|||
procs_base.host_specializations.insert_host_exposed(
|
||||
mono_env.subs,
|
||||
LambdaName::no_niche(symbol),
|
||||
declarations.host_exposed_annotations.get(&index).cloned(),
|
||||
get_host_annotation(&declarations, index),
|
||||
expr_var,
|
||||
);
|
||||
}
|
||||
|
@ -5765,7 +5774,7 @@ fn build_pending_specializations<'a>(
|
|||
procs_base.host_specializations.insert_host_exposed(
|
||||
mono_env.subs,
|
||||
LambdaName::no_niche(symbol),
|
||||
declarations.host_exposed_annotations.get(&index).cloned(),
|
||||
get_host_annotation(&declarations, index),
|
||||
expr_var,
|
||||
);
|
||||
}
|
||||
|
@ -5840,7 +5849,7 @@ fn build_pending_specializations<'a>(
|
|||
procs_base.host_specializations.insert_host_exposed(
|
||||
mono_env.subs,
|
||||
LambdaName::no_niche(symbol),
|
||||
declarations.host_exposed_annotations.get(&index).cloned(),
|
||||
get_host_annotation(&declarations, index),
|
||||
expr_var,
|
||||
);
|
||||
}
|
||||
|
@ -5906,7 +5915,7 @@ fn build_pending_specializations<'a>(
|
|||
procs_base.host_specializations.insert_host_exposed(
|
||||
mono_env.subs,
|
||||
LambdaName::no_niche(symbol),
|
||||
None,
|
||||
Variable::NULL,
|
||||
expr_var,
|
||||
);
|
||||
}
|
||||
|
@ -5978,7 +5987,7 @@ fn build_pending_specializations<'a>(
|
|||
procs_base.host_specializations.insert_host_exposed(
|
||||
mono_env.subs,
|
||||
LambdaName::no_niche(symbol),
|
||||
None,
|
||||
Variable::NULL,
|
||||
expr_var,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue