replace unreachable! with internal_error! in expr canonicalization

See https://github.com/roc-lang/roc/issues/2046
This commit is contained in:
Elias Mulhall 2023-11-26 08:28:47 -05:00
parent 69b72866db
commit 0a48962abe
No known key found for this signature in database
GPG key ID: 8D1F3C219EAB45F2

View file

@ -1062,10 +1062,10 @@ pub fn canonicalize_expr<'a>(
})
}
ast::Expr::RecordBuilder(_) => {
unreachable!("RecordBuilder should have been desugared by now")
internal_error!("RecordBuilder should have been desugared by now")
}
ast::Expr::Backpassing(_, _, _) => {
unreachable!("Backpassing should have been desugared by now")
internal_error!("Backpassing should have been desugared by now")
}
ast::Expr::Closure(loc_arg_patterns, loc_body_expr) => {
let (closure_data, output) =
@ -2338,10 +2338,10 @@ pub fn inline_calls(var_store: &mut VarStore, expr: Expr) -> Expr {
loc_answer.value
}
Some(_) => {
unreachable!("Tried to inline a non-function");
internal_error!("Tried to inline a non-function");
}
None => {
unreachable!(
internal_error!(
"Tried to inline a builtin that wasn't registered: {:?}",
symbol
);