minor fix and some refactoring on the if statements

This commit is contained in:
microproofs
2024-01-20 16:34:33 -05:00
committed by Kasey
parent 82fc82ceee
commit eda4e259d6
2 changed files with 27 additions and 31 deletions

View File

@@ -1506,8 +1506,8 @@ impl<'a> CodeGenerator<'a> {
vec![fst_name.clone(), snd_name.clone()],
tipo.clone(),
AirTree::local_var(pair_name, tipo.clone()),
None,
false,
msg_func.clone(),
msg_func.is_some(),
);
let expect_fst = self.expect_type_assign(
@@ -5223,34 +5223,34 @@ impl<'a> CodeGenerator<'a> {
if names[1] != "_" {
term = term
.lambda(names[1].clone())
.apply(if error_term != Term::Error {
.apply(if error_term == Term::Error {
builder::convert_data_to_type(
Term::snd_pair().apply(Term::var(format!("__tuple_{list_id}"))),
&inner_types[1],
)
} else {
builder::convert_data_to_type_debug(
Term::snd_pair().apply(Term::var(format!("__tuple_{list_id}"))),
&inner_types[1],
error_term.clone(),
)
} else {
builder::convert_data_to_type(
Term::snd_pair().apply(Term::var(format!("__tuple_{list_id}"))),
&inner_types[1],
)
});
}
if names[0] != "_" {
term = term
.lambda(names[0].clone())
.apply(if error_term != Term::Error {
.apply(if error_term == Term::Error {
builder::convert_data_to_type(
Term::fst_pair().apply(Term::var(format!("__tuple_{list_id}"))),
&inner_types[0],
)
} else {
builder::convert_data_to_type_debug(
Term::fst_pair().apply(Term::var(format!("__tuple_{list_id}"))),
&inner_types[0],
error_term,
)
} else {
builder::convert_data_to_type(
Term::fst_pair().apply(Term::var(format!("__tuple_{list_id}"))),
&inner_types[0],
)
})
}