From 8f0c335422091d1802c1ccf6d50468f3faf62bcc Mon Sep 17 00:00:00 2001 From: CrescentonC Date: Mon, 19 Jul 2021 13:52:53 +0800 Subject: [PATCH] directly return after folding the special case of list comprehension --- nac3core/src/typecheck/expression_inference.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nac3core/src/typecheck/expression_inference.rs b/nac3core/src/typecheck/expression_inference.rs index 1fa3c3c76..2f11a8c29 100644 --- a/nac3core/src/typecheck/expression_inference.rs +++ b/nac3core/src/typecheck/expression_inference.rs @@ -20,7 +20,7 @@ impl<'a> ast::fold::Fold<()> for InferenceContext<'a> { // assert_eq!(node.custom, None); let expr = match &node.node { - ast::ExprKind::ListComp { .. } => self.fold_listcomp(node)?, + ast::ExprKind::ListComp { .. } => return self.fold_listcomp(node), _ => rustpython_parser::ast::fold::fold_expr(self, node)? };