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 { .. } => {
|
Pattern::Discard { .. } => {
|
||||||
if matches!(assignment_properties.kind, AssignmentKind::Let) {
|
if matches!(assignment_properties.kind, AssignmentKind::Expect)
|
||||||
pattern_stack.let_assignment("_", value_stack);
|
&& assignment_properties.value_type.is_data()
|
||||||
} else {
|
&& !tipo.is_data()
|
||||||
|
{
|
||||||
self.expect_pattern(
|
self.expect_pattern(
|
||||||
pattern,
|
pattern,
|
||||||
pattern_stack,
|
pattern_stack,
|
||||||
value_stack,
|
value_stack,
|
||||||
tipo,
|
tipo,
|
||||||
assignment_properties,
|
assignment_properties,
|
||||||
)
|
);
|
||||||
|
} else {
|
||||||
|
pattern_stack.let_assignment("_", value_stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list @ Pattern::List { .. } => {
|
list @ Pattern::List { .. } => {
|
||||||
|
|
Loading…
Reference in New Issue