fix: "when bool is" was not properly assigning term to body when not a complex clause

Add some end to end tests to test uplc
This commit is contained in:
microproofs
2023-04-23 12:51:23 -04:00
parent 9bb1a88f23
commit ff87a4c60f
2 changed files with 72 additions and 1 deletions

View File

@@ -4402,7 +4402,7 @@ impl<'a> CodeGenerator<'a> {
let other_clauses = if complex_clause {
Term::var("__other_clauses_delayed")
} else {
term.clone()
term.clone().delay()
};
if matches!(clause, Term::Constant(boolean) if matches!(boolean.as_ref(), UplcConstant::Bool(true)))
@@ -4418,6 +4418,8 @@ impl<'a> CodeGenerator<'a> {
if complex_clause {
term = body.lambda("__other_clauses_delayed").apply(term.delay());
} else {
term = body;
}
} else {
let condition = if tipo.is_int() {