From 8289e3d32e5e517489395998e3bc19ef15424e50 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 24 May 2023 09:39:53 -0400 Subject: [PATCH] Visit TypeVar and NewType name arguments --- crates/ruff/src/checkers/ast/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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); }