simplify information passed to mono

This commit is contained in:
Folkert 2023-07-24 21:54:39 +02:00
parent e549ea78fe
commit 126c3f1536
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 24 additions and 22 deletions

View file

@ -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,
);
}