From cb450372d657d5d859f633fbeaf88fa80404bbb3 Mon Sep 17 00:00:00 2001 From: ychenfo Date: Sun, 12 Dec 2021 05:40:22 +0800 Subject: [PATCH] nac3core: add missing expr concrete type check --- nac3core/src/typecheck/function_check.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nac3core/src/typecheck/function_check.rs b/nac3core/src/typecheck/function_check.rs index 65c810e0..b65f4995 100644 --- a/nac3core/src/typecheck/function_check.rs +++ b/nac3core/src/typecheck/function_check.rs @@ -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)?; }