Skip to content

Commit 07a3b4e

Browse files
committed
Use visit_annotation for type alias value
This was a follow up task from astral-sh#17180 (comment) separated into this PR.
1 parent da6b68c commit 07a3b4e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

crates/ruff_python_ast/ast.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ doc = "See also [TypeAlias](https://docs.python.org/3/library/ast.html#ast.TypeA
116116
fields = [
117117
{ name = "name", type = "Expr" },
118118
{ name = "type_params", type = "Box<crate::TypeParams>?" },
119-
{ name = "value", type = "Expr" },
119+
{ name = "value", type = "Expr", is_annotation = true },
120120
]
121121

122122
[Stmt.nodes.StmtAssign]

crates/ruff_python_ast/src/generated.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ruff_python_ast_integration_tests/tests/snapshots/source_order__type_aliases.snap

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ expression: trace
1616
- TypeParamParamSpec
1717
- Identifier
1818
- ExprSubscript
19-
- ExprName
20-
- ExprName
19+
- ExprSubscript
20+
- ExprName
21+
- ExprName

0 commit comments

Comments
 (0)