|
10 | 10 | NamedTupleExpr,
|
11 | 11 | NewTypeExpr,
|
12 | 12 | PromoteExpr,
|
| 13 | + TypeAlias, |
13 | 14 | TypeAliasExpr,
|
| 15 | + TypeAliasStmt, |
14 | 16 | TypeApplication,
|
15 | 17 | TypedDictExpr,
|
16 | 18 | TypeVarExpr,
|
@@ -48,9 +50,7 @@ def visit_class_def(self, o: ClassDef, /) -> None:
|
48 | 50 |
|
49 | 51 | def visit_type_alias_expr(self, o: TypeAliasExpr, /) -> None:
|
50 | 52 | super().visit_type_alias_expr(o)
|
51 |
| - self.in_type_alias_expr = True |
52 |
| - o.node.target.accept(self) |
53 |
| - self.in_type_alias_expr = False |
| 53 | + o.node.accept(self) |
54 | 54 |
|
55 | 55 | def visit_type_var_expr(self, o: TypeVarExpr, /) -> None:
|
56 | 56 | super().visit_type_var_expr(o)
|
@@ -81,6 +81,17 @@ def visit_assignment_stmt(self, o: AssignmentStmt, /) -> None:
|
81 | 81 | super().visit_assignment_stmt(o)
|
82 | 82 | self.visit_optional_type(o.type)
|
83 | 83 |
|
| 84 | + def visit_type_alias_stmt(self, o: TypeAliasStmt, /) -> None: |
| 85 | + super().visit_type_alias_stmt(o) |
| 86 | + if o.alias_node is not None: |
| 87 | + o.alias_node.accept(self) |
| 88 | + |
| 89 | + def visit_type_alias(self, o: TypeAlias, /) -> None: |
| 90 | + super().visit_type_alias(o) |
| 91 | + self.in_type_alias_expr = True |
| 92 | + o.target.accept(self) |
| 93 | + self.in_type_alias_expr = False |
| 94 | + |
84 | 95 | def visit_for_stmt(self, o: ForStmt, /) -> None:
|
85 | 96 | super().visit_for_stmt(o)
|
86 | 97 | self.visit_optional_type(o.index_type)
|
|
0 commit comments