mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
better error message for when morphic did not specialize
This commit is contained in:
parent
fa57ff88a5
commit
3d7b42deba
1 changed files with 21 additions and 12 deletions
|
@ -4109,19 +4109,28 @@ pub fn build_proc<'a, 'ctx, 'env>(
|
||||||
let func_solutions = mod_solutions.func_solutions(func_name).unwrap();
|
let func_solutions = mod_solutions.func_solutions(func_name).unwrap();
|
||||||
|
|
||||||
let mut it = func_solutions.specs();
|
let mut it = func_solutions.specs();
|
||||||
let func_spec = it.next().unwrap();
|
let evaluator = match it.next() {
|
||||||
|
Some(func_spec) => {
|
||||||
debug_assert!(
|
debug_assert!(
|
||||||
it.next().is_none(),
|
it.next().is_none(),
|
||||||
"we expect only one specialization of this symbol"
|
"we expect only one specialization of this symbol"
|
||||||
);
|
);
|
||||||
|
|
||||||
let evaluator = function_value_by_func_spec(
|
function_value_by_func_spec(
|
||||||
env,
|
env,
|
||||||
*func_spec,
|
*func_spec,
|
||||||
symbol,
|
symbol,
|
||||||
top_level.arguments,
|
top_level.arguments,
|
||||||
&top_level.result,
|
&top_level.result,
|
||||||
);
|
)
|
||||||
|
}
|
||||||
|
None => {
|
||||||
|
// morphic did not generate a specialization for this function,
|
||||||
|
// therefore it must actually be unused.
|
||||||
|
// An example is our closure callers
|
||||||
|
panic!("morphic did not specialize {:?}", symbol);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let ident_string = proc.name.as_str(&env.interns);
|
let ident_string = proc.name.as_str(&env.interns);
|
||||||
let fn_name: String = format!("{}_1", ident_string);
|
let fn_name: String = format!("{}_1", ident_string);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue