Skip to content

Commit

Permalink
Fix soft casting case
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroProofs committed Sep 12, 2024
1 parent 2a9faf7 commit 288c089
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/aiken-lang/src/gen_uplc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,13 +666,14 @@ impl<'a> CodeGenerator<'a> {
self.build(final_else, module_build_name, &[]),
|acc, branch| {
let condition = self.build(&branch.condition, module_build_name, &[]);
let body = self.build(&branch.body, module_build_name, &[]);

match &branch.is {
Some((pattern, tipo)) => {
introduce_pattern(&mut self.interner, pattern);
self.interner.intern("acc_var".to_string());

let body = self.build(&branch.body, module_build_name, &[]);

let acc_var =
self.interner.lookup_interned(&"acc_var".to_string());

Expand Down Expand Up @@ -703,7 +704,12 @@ impl<'a> CodeGenerator<'a> {

tree
}
None => AirTree::if_branch(tipo.clone(), condition, body, acc),
None => AirTree::if_branch(
tipo.clone(),
condition,
self.build(&branch.body, module_build_name, &[]),
acc,
),
}
},
)
Expand Down

0 comments on commit 288c089

Please sign in to comment.