diff --git a/compiler/can/src/builtins.rs b/compiler/can/src/builtins.rs index 286c24554b..e170f11c5f 100644 --- a/compiler/can/src/builtins.rs +++ b/compiler/can/src/builtins.rs @@ -2119,7 +2119,7 @@ fn list_map3(symbol: Symbol, var_store: &mut VarStore) -> Def { } /// Dict.hashTestOnly : k, v -> Nat -pub fn dict_hash_test_only(symbol: Symbol, var_store: &mut VarStore) -> Def { +fn dict_hash_test_only(symbol: Symbol, var_store: &mut VarStore) -> Def { lowlevel_2(symbol, LowLevel::Hash, var_store) } diff --git a/compiler/mono/src/ir.rs b/compiler/mono/src/ir.rs index 58267ef608..e8273eb055 100644 --- a/compiler/mono/src/ir.rs +++ b/compiler/mono/src/ir.rs @@ -6075,10 +6075,7 @@ fn call_by_name<'a>( // exactly once. match &mut procs.pending_specializations { Some(pending_specializations) => { - 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 { + if env.is_imported_symbol(proc_name) { add_needed_external(procs, env, original_fn_var, proc_name); } else { // register the pending specialization, so this gets code genned later diff --git a/compiler/test_gen/src/helpers/eval.rs b/compiler/test_gen/src/helpers/eval.rs index fdc9dee3dd..499a8d1ed8 100644 --- a/compiler/test_gen/src/helpers/eval.rs +++ b/compiler/test_gen/src/helpers/eval.rs @@ -1,7 +1,7 @@ use libloading::Library; use roc_build::link::module_to_dylib; use roc_build::program::FunctionIterator; -use roc_can::builtins::{builtin_defs_map, dict_hash_test_only}; +use roc_can::builtins::builtin_defs_map; use roc_can::def::Def; use roc_collections::all::{MutMap, MutSet}; use roc_module::symbol::Symbol; @@ -20,13 +20,7 @@ fn promote_expr_to_module(src: &str) -> String { buffer } pub fn test_builtin_defs(symbol: Symbol, var_store: &mut VarStore) -> Option { - match builtin_defs_map(symbol, var_store) { - Some(def) => Some(def), - None => match symbol { - Symbol::DICT_TEST_HASH => Some(dict_hash_test_only(symbol, var_store)), - _ => None, - }, - } + builtin_defs_map(symbol, var_store) } // this is not actually dead code, but only used by cfg_test modules