mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
builtins are not technically imported
This commit is contained in:
parent
16fbff6eda
commit
a565ca79b8
2 changed files with 21 additions and 3 deletions
|
@ -968,6 +968,16 @@ impl<'a> Expr<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Stmt<'a> {
|
impl<'a> Stmt<'a> {
|
||||||
|
pub fn new(
|
||||||
|
env: &mut Env<'a, '_>,
|
||||||
|
can_expr: roc_can::expr::Expr,
|
||||||
|
var: Variable,
|
||||||
|
procs: &mut Procs<'a>,
|
||||||
|
layout_cache: &mut LayoutCache<'a>,
|
||||||
|
) -> Self {
|
||||||
|
from_can(env, var, can_expr, procs, layout_cache)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn to_doc<'b, D, A>(&'b self, alloc: &'b D) -> DocBuilder<'b, D, A>
|
pub fn to_doc<'b, D, A>(&'b self, alloc: &'b D) -> DocBuilder<'b, D, A>
|
||||||
where
|
where
|
||||||
D: DocAllocator<'b, A>,
|
D: DocAllocator<'b, A>,
|
||||||
|
@ -4459,7 +4469,10 @@ fn call_by_name<'a>(
|
||||||
// exactly once.
|
// exactly once.
|
||||||
match &mut procs.pending_specializations {
|
match &mut procs.pending_specializations {
|
||||||
Some(pending_specializations) => {
|
Some(pending_specializations) => {
|
||||||
if assigned.module_id() != proc_name.module_id() {
|
let is_imported = assigned.module_id() != proc_name.module_id();
|
||||||
|
// builtins are currently (re)defined in each module, so not really imported
|
||||||
|
let is_builtin = proc_name.is_builtin();
|
||||||
|
if is_imported && !is_builtin {
|
||||||
specialize_imported_symbol(
|
specialize_imported_symbol(
|
||||||
env,
|
env,
|
||||||
&mut procs.externals_we_need,
|
&mut procs.externals_we_need,
|
||||||
|
|
|
@ -95,8 +95,13 @@ mod test_reporting {
|
||||||
home,
|
home,
|
||||||
ident_ids: &mut ident_ids,
|
ident_ids: &mut ident_ids,
|
||||||
};
|
};
|
||||||
let _mono_expr =
|
let _mono_expr = Stmt::new(
|
||||||
Stmt::new(&mut mono_env, loc_expr.value, &mut procs, &mut layout_cache);
|
&mut mono_env,
|
||||||
|
loc_expr.value,
|
||||||
|
var,
|
||||||
|
&mut procs,
|
||||||
|
&mut layout_cache,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok((unify_problems, can_problems, mono_problems, home, interns))
|
Ok((unify_problems, can_problems, mono_problems, home, interns))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue