Gracefully recover from malformed closure in repl

This commit is contained in:
Richard Feldman 2022-10-30 03:31:54 -04:00
parent e93d9b81d8
commit 51cb51d485
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
3 changed files with 1 additions and 6 deletions

View file

@ -1,6 +1,5 @@
use bumpalo::collections::Vec;
use bumpalo::Bump;
use roc_error_macros::internal_error;
use roc_types::types::AliasKind;
use std::cmp::{max_by_key, min_by_key};
@ -68,9 +67,7 @@ pub fn jit_to_ast<'a, A: ReplApp<'a>>(
// it's `main` and can be executed.
jit_to_ast_help(&mut env, app, main_fn_name, &result, var)
}
_ => {
internal_error!("The layout generated for {main_fn_name} was not a Procedure!")
}
_ => Expr::MalformedClosure,
}
}