fix: needed a stricter check for expect_pattern func on discard pattern
This commit is contained in:
parent
1c7b8e0286
commit
d641f731b7
|
@ -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 { .. } => {
|
||||
|
|
Loading…
Reference in New Issue