From 1c170f5c411ab305f6466748c3819c1b768c79b4 Mon Sep 17 00:00:00 2001 From: ychenfo Date: Tue, 21 Sep 2021 13:19:13 +0800 Subject: [PATCH] nac3core: type inferencer fix the pass statement --- nac3core/src/toplevel/test.rs | 2 +- nac3core/src/typecheck/type_inferencer/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nac3core/src/toplevel/test.rs b/nac3core/src/toplevel/test.rs index 54893d36..cac627af 100644 --- a/nac3core/src/toplevel/test.rs +++ b/nac3core/src/toplevel/test.rs @@ -939,7 +939,7 @@ fn test_analyze(source: Vec<&str>, res: Vec<&str>) { indoc! {" class A: def fun(self): - 1 + 2 + pass "}, indoc!{" class B: diff --git a/nac3core/src/typecheck/type_inferencer/mod.rs b/nac3core/src/typecheck/type_inferencer/mod.rs index 8e32922e..8c1f68be 100644 --- a/nac3core/src/typecheck/type_inferencer/mod.rs +++ b/nac3core/src/typecheck/type_inferencer/mod.rs @@ -128,7 +128,7 @@ impl<'a> fold::Fold<()> for Inferencer<'a> { } } ast::StmtKind::AnnAssign { .. } | ast::StmtKind::Expr { .. } => {} - ast::StmtKind::Break | ast::StmtKind::Continue => {} + ast::StmtKind::Break | ast::StmtKind::Continue | ast::StmtKind::Pass => {} ast::StmtKind::Return { value } => match (value, self.function_data.return_type) { (Some(v), Some(v1)) => { self.unify(v.custom.unwrap(), v1, &v.location)?;