Skip to content

Commit

Permalink
fix: needed a stricter check for expect_pattern func on discard pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroProofs committed Jun 28, 2023
1 parent 1c7b8e0 commit d641f73
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/aiken-lang/src/gen_uplc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1765,16 +1765,19 @@ impl<'a> CodeGenerator<'a> {
);
}
Pattern::Discard { .. } => {
if matches!(assignment_properties.kind, AssignmentKind::Let) {
pattern_stack.let_assignment("_", value_stack);
} else {
if matches!(assignment_properties.kind, AssignmentKind::Expect)
&& assignment_properties.value_type.is_data()
&& !tipo.is_data()
{
self.expect_pattern(
pattern,
pattern_stack,
value_stack,
tipo,
assignment_properties,
)
);
} else {
pattern_stack.let_assignment("_", value_stack);
}
}
list @ Pattern::List { .. } => {
Expand Down

0 comments on commit d641f73

Please sign in to comment.