diff --git a/crates/ruff/src/checkers/ast/mod.rs b/crates/ruff/src/checkers/ast/mod.rs index 97301caeeef67f..0de41c32f19330 100644 --- a/crates/ruff/src/checkers/ast/mod.rs +++ b/crates/ruff/src/checkers/ast/mod.rs @@ -4061,12 +4061,18 @@ where } Some(Callable::NewType) => { self.visit_expr(func); + if !args.is_empty() { + self.visit_non_type_definition(&args[0]); + } for expr in args.iter().skip(1) { self.visit_type_definition(expr); } } Some(Callable::TypeVar) => { self.visit_expr(func); + if !args.is_empty() { + self.visit_non_type_definition(&args[0]); + } for expr in args.iter().skip(1) { self.visit_type_definition(expr); }