mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
better debug reporting
This commit is contained in:
parent
76c9a15e37
commit
ee5d68a6cc
1 changed files with 4 additions and 20 deletions
|
@ -4686,27 +4686,11 @@ fn from_can_when<'a>(
|
||||||
}
|
}
|
||||||
let opt_branches = to_opt_branches(env, region, branches, layout_cache);
|
let opt_branches = to_opt_branches(env, region, branches, layout_cache);
|
||||||
|
|
||||||
let cond_layout = match layout_cache.from_var(env.arena, cond_var, env.subs) {
|
let cond_layout =
|
||||||
Ok(cached) => cached,
|
return_on_layout_error!(env, layout_cache.from_var(env.arena, cond_var, env.subs));
|
||||||
Err(LayoutProblem::UnresolvedTypeVar(_)) => {
|
|
||||||
return Stmt::RuntimeError(env.arena.alloc(format!(
|
|
||||||
"UnresolvedTypeVar {} line {}",
|
|
||||||
file!(),
|
|
||||||
line!()
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
Err(LayoutProblem::Erroneous) => {
|
|
||||||
return Stmt::RuntimeError(env.arena.alloc(format!(
|
|
||||||
"Erroneous {} line {}",
|
|
||||||
file!(),
|
|
||||||
line!()
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let ret_layout = layout_cache
|
let ret_layout =
|
||||||
.from_var(env.arena, expr_var, env.subs)
|
return_on_layout_error!(env, layout_cache.from_var(env.arena, expr_var, env.subs));
|
||||||
.unwrap_or_else(|err| panic!("TODO turn this into a RuntimeError {:?}", err));
|
|
||||||
|
|
||||||
let arena = env.arena;
|
let arena = env.arena;
|
||||||
let it = opt_branches
|
let it = opt_branches
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue