From 8e5d0cc385387b616c120d279ac1023c1785e9f7 Mon Sep 17 00:00:00 2001 From: Zanie Date: Fri, 14 Jul 2023 12:09:44 -0500 Subject: [PATCH] Add parenthized multiline type alias test case --- parser/src/parser.rs | 3 +++ ...parser__tests__parse_type_declaration.snap | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/parser/src/parser.rs b/parser/src/parser.rs index d5bb7d3..b55d4de 100644 --- a/parser/src/parser.rs +++ b/parser/src/parser.rs @@ -920,6 +920,9 @@ type X \ = int type X = \ int +type X = ( + int +) "#; insta::assert_debug_snapshot!(ast::Suite::parse(source, "").unwrap()); } diff --git a/parser/src/snapshots/rustpython_parser__parser__tests__parse_type_declaration.snap b/parser/src/snapshots/rustpython_parser__parser__tests__parse_type_declaration.snap index bb8eae8..b21c77f 100644 --- a/parser/src/snapshots/rustpython_parser__parser__tests__parse_type_declaration.snap +++ b/parser/src/snapshots/rustpython_parser__parser__tests__parse_type_declaration.snap @@ -706,4 +706,28 @@ expression: "ast::Suite::parse(source, \"\").unwrap()" ), }, ), + TypeAlias( + StmtTypeAlias { + range: 415..435, + name: Name( + ExprName { + range: 420..421, + id: Identifier( + "X", + ), + ctx: Load, + }, + ), + type_params: [], + value: Name( + ExprName { + range: 430..433, + id: Identifier( + "int", + ), + ctx: Load, + }, + ), + }, + ), ]