diff --git a/parser/src/parser.rs b/parser/src/parser.rs index 58ff722..d5bb7d3 100644 --- a/parser/src/parser.rs +++ b/parser/src/parser.rs @@ -952,6 +952,9 @@ a = ( a = ( type(b) ) +type ( + X = int +) "#; insta::assert_debug_snapshot!(ast::Suite::parse(source, "").unwrap()); } diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__type_as_identifier.snap b/parser/src/snapshots/rustpython_parser__parser__tests__type_as_identifier.snap index c8cec12..53d337a 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__type_as_identifier.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__type_as_identifier.snap @@ -936,4 +936,43 @@ expression: "ast::Suite::parse(source, \"\").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, + }, + ), + }, + ], + }, + ), + }, + ), ]