Add test for parenthized multiline type as identifier

This commit is contained in:
Zanie 2023-07-14 12:03:34 -05:00
parent 1622c8f2da
commit e2e1c2b705
2 changed files with 42 additions and 0 deletions

View file

@ -952,6 +952,9 @@ a = (
a = (
type(b)
)
type (
X = int
)
"#;
insta::assert_debug_snapshot!(ast::Suite::parse(source, "<test>").unwrap());
}

View file

@ -936,4 +936,43 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
type_comment: None,
},
),
Expr(
StmtExpr {
range: 599..616,
value: Call(
ExprCall {
range: 599..616,
func: Name(
ExprName {
range: 599..603,
id: Identifier(
"type",
),
ctx: Load,
},
),
args: [],
keywords: [
Keyword {
range: 607..614,
arg: Some(
Identifier(
"X",
),
),
value: Name(
ExprName {
range: 611..614,
id: Identifier(
"int",
),
ctx: Load,
},
),
},
],
},
),
},
),
]