fix: one builtin error wasn't be caught with a messaged exception

This commit is contained in:
microproofs 2024-01-22 17:54:03 -05:00 committed by Kasey
parent eda4e259d6
commit 3a44c45b48
1 changed files with 12 additions and 1 deletions

View File

@ -1587,13 +1587,24 @@ pub fn list_access_to_uplc(
if matches!(expect_level, ExpectLevel::None) {
acc.lambda(name).apply(head_list).lambda(tail_name)
} else {
} else if error_term == Term::Error {
Term::tail_list()
.apply(Term::var(tail_name.to_string()))
.delayed_choose_list(acc, error_term.clone())
.lambda(name)
.apply(head_list)
.lambda(tail_name)
} else {
Term::var(tail_name.to_string())
.delayed_choose_list(
error_term.clone(),
Term::tail_list()
.apply(Term::var(tail_name.to_string()))
.delayed_choose_list(acc, error_term.clone())
.lambda(name)
.apply(head_list),
)
.lambda(tail_name)
}
} else if name == "_" {
if matches!(expect_level, ExpectLevel::None) || error_term == Term::Error {