Skip to content

Commit

Permalink
Fix edge case with traces off and usage of softcast and hardcast on t…
Browse files Browse the repository at this point in the history
…he same type
  • Loading branch information
MicroProofs committed Sep 20, 2024
1 parent 83ac723 commit 18e79db
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/aiken-lang/src/gen_uplc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2233,7 +2233,14 @@ impl<'a> CodeGenerator<'a> {
IndexMap::new()
};

let data_type_name = format!("__expect_{}_{}", data_type.name, data_type_variant);
let data_type_name = if otherwise.is_some() {
format!(
"__expect_{}_{}_otherwise",
data_type.name, data_type_variant
)
} else {
format!("__expect_{}_{}", data_type.name, data_type_variant)
};
let function = self.code_gen_functions.get(&data_type_name);

// mutate code_gen_funcs and defined_data_types in this if branch
Expand Down

0 comments on commit 18e79db

Please sign in to comment.