From c5bef860018cccda6b93eab65802df87eda11916 Mon Sep 17 00:00:00 2001 From: CrescentonC Date: Wed, 14 Jul 2021 17:19:03 +0800 Subject: [PATCH] direct impl fold trait on InferenceContext, now code is cleaner, need further test and review --- nac3core/src/typecheck/expression_inference.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nac3core/src/typecheck/expression_inference.rs b/nac3core/src/typecheck/expression_inference.rs index ac055a56..85cc043b 100644 --- a/nac3core/src/typecheck/expression_inference.rs +++ b/nac3core/src/typecheck/expression_inference.rs @@ -8,6 +8,7 @@ use crate::typecheck::primitives; use rustpython_parser::ast; use rustpython_parser::ast::fold::Fold; +// REVIEW: direct impl fold trait on InferenceContext impl<'a> ast::fold::Fold> for InferenceContext<'a> { type TargetU = Option; type Error = String; @@ -379,6 +380,7 @@ impl<'a> InferenceContext<'a> { } } + // some pre-folds need special handling fn prefold_list_comprehension(&mut self, expr: ast::Expr>) -> Result>, String> { if let ast::Expr { location,