diff --git a/crates/ruff/src/checkers/ast/mod.rs b/crates/ruff/src/checkers/ast/mod.rs index 301bd708260147..f9727fd9901969 100644 --- a/crates/ruff/src/checkers/ast/mod.rs +++ b/crates/ruff/src/checkers/ast/mod.rs @@ -1750,10 +1750,10 @@ impl<'a> Checker<'a> { self.semantic.restore(snapshot); match type_param { - ast::TypeParam::TypeVar(ast::TypeParamTypeVar { bound, .. }) => { - if let Some(bound) = bound { - self.visit_expr(bound); - } + ast::TypeParam::TypeVar(ast::TypeParamTypeVar { + bound: Some(bound), .. + }) => { + self.visit_expr(bound); } _ => {} }