nac3core: add missing expr concrete type check

This commit is contained in:
ychenfo 2021-12-12 05:40:22 +08:00 committed by Gitea
parent ff27a1697e
commit cb450372d6
1 changed files with 2 additions and 0 deletions

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)?;
}