From cad5a3e7a77484541bdbd684e703918fc0eb6e6a Mon Sep 17 00:00:00 2001 From: harupy Date: Wed, 11 Oct 2023 15:14:49 +0900 Subject: [PATCH] Visit pattern match guard as a boolean test --- crates/ruff_linter/src/checkers/ast/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/checkers/ast/mod.rs b/crates/ruff_linter/src/checkers/ast/mod.rs index bbf245a1b3eb9..e67a8ce16272e 100644 --- a/crates/ruff_linter/src/checkers/ast/mod.rs +++ b/crates/ruff_linter/src/checkers/ast/mod.rs @@ -1367,7 +1367,7 @@ where fn visit_match_case(&mut self, match_case: &'b MatchCase) { self.visit_pattern(&match_case.pattern); if let Some(expr) = &match_case.guard { - self.visit_expr(expr); + self.visit_boolean_test(expr); } self.semantic.push_branch();