mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +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 cond_layout = match layout_cache.from_var(env.arena, cond_var, env.subs) {
|
||||
Ok(cached) => cached,
|
||||
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 cond_layout =
|
||||
return_on_layout_error!(env, layout_cache.from_var(env.arena, cond_var, env.subs));
|
||||
|
||||
let ret_layout = layout_cache
|
||||
.from_var(env.arena, expr_var, env.subs)
|
||||
.unwrap_or_else(|err| panic!("TODO turn this into a RuntimeError {:?}", err));
|
||||
let ret_layout =
|
||||
return_on_layout_error!(env, layout_cache.from_var(env.arena, expr_var, env.subs));
|
||||
|
||||
let arena = env.arena;
|
||||
let it = opt_branches
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue