From f665ea358b08a7c3df864bb0f495c69dba35bcd8 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Wed, 28 Jul 2021 10:44:58 +0800 Subject: [PATCH] fixed fold --- nac3core/src/typecheck/type_inferencer/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nac3core/src/typecheck/type_inferencer/mod.rs b/nac3core/src/typecheck/type_inferencer/mod.rs index 5eecb1829..754ecd97b 100644 --- a/nac3core/src/typecheck/type_inferencer/mod.rs +++ b/nac3core/src/typecheck/type_inferencer/mod.rs @@ -56,9 +56,9 @@ impl<'a> fold::Fold<()> for Inferencer<'a> { let stmt = match node.node { // we don't want fold over type annotation ast::StmtKind::AnnAssign { target, annotation, value, simple } => { - let target = Box::new(fold::fold_expr(self, *target)?); + let target = Box::new(self.fold_expr(*target)?); let value = if let Some(v) = value { - let ty = Box::new(fold::fold_expr(self, *v)?); + let ty = Box::new(self.fold_expr(*v)?); self.unifier.unify(target.custom.unwrap(), ty.custom.unwrap())?; Some(ty) } else {