Fix two canonicalization crashes: try() and overflowed tuple indexes

This commit is contained in:
Joshua Warner 2025-01-11 13:51:30 -08:00
parent 7d464a2989
commit e0ef01fa82
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
11 changed files with 114 additions and 16 deletions

View file

@ -0,0 +1,18 @@
@0-6 SpaceAfter(
Apply(
@0-5 PncApply(
@0-3 Try,
[],
),
[
@5-6 Var {
module_name: "",
ident: "t",
},
],
Space,
),
[
Newline,
],
)

View file

@ -0,0 +1 @@
.18888888888888888888

View file

@ -0,0 +1,10 @@
@0-21 SpaceAfter(
AccessorFunction(
TupleIndex(
"18888888888888888888",
),
),
[
Newline,
],
)

View file

@ -0,0 +1 @@
.18888888888888888888

View file

@ -436,6 +436,7 @@ mod test_snapshots {
pass/empty_record_newline_assign.expr,
pass/empty_record_update.expr,
pass/empty_string.expr,
pass/empty_try_pnc.expr,
pass/equals.expr,
pass/equals_with_spaces.expr,
pass/expect.expr,
@ -485,6 +486,7 @@ mod test_snapshots {
pass/int_with_underscore.expr,
pass/lambda_in_chain.expr,
pass/lambda_indent.expr,
pass/large_tuple_index.expr,
pass/list_closing_indent_not_enough.expr,
pass/list_closing_same_indent_no_trailing_comma.expr,
pass/list_closing_same_indent_with_trailing_comma.expr,