For loop type inference fix #128

Merged
sb10q merged 2 commits from for_loop_type_fix into master 2021-12-19 18:01:49 +08:00
1 changed files with 2 additions and 0 deletions
Showing only changes of commit 4a63ba42a2 - Show all commits

View File

@ -24,11 +24,13 @@ impl<'a> Inferencer<'a> {
if !defined_identifiers.contains(id) {
defined_identifiers.insert(*id);
}
self.check_expr(pattern, defined_identifiers)?;
self.should_have_value(pattern)?;
Ok(())
}
ExprKind::Tuple { elts, .. } => {
for elt in elts.iter() {
self.check_expr(pattern, defined_identifiers)?;
self.check_pattern(elt, defined_identifiers)?;
self.should_have_value(elt)?;
}