Fix parens around as in tag union

This commit is contained in:
Joshua Warner 2024-12-18 10:42:18 -08:00
parent 7ba5135602
commit 512be85f9a
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 75 additions and 1 deletions

View file

@ -0,0 +1,2 @@
1 : [N (* as S)]
_

View file

@ -0,0 +1,56 @@
@0-15 SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-13,
],
space_before: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
],
space_after: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
],
spaces: [],
type_defs: [],
value_defs: [
Annotation(
@0-1 NumLiteral(
"1",
),
@2-13 TagUnion {
ext: None,
tags: [
@3-12 Apply {
name: @3-4 "N",
args: [
@5-0 As(
@5-6 Wildcard,
[],
TypeHeader {
name: @9-10 "S",
vars: [],
},
),
],
},
],
},
),
],
},
@14-15 SpaceBefore(
Underscore(
"",
),
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,2 @@
1:[N(*as(S))]
_

View file

@ -684,6 +684,7 @@ mod test_snapshots {
pass/tag_destructure_bang.expr,
pass/tag_destructure_bang_no_space.expr,
pass/tag_pattern.expr,
pass/tag_union_ann_with_as.expr,
pass/ten_times_eleven.expr,
pass/three_arg_closure.expr,
pass/triple_paren_pat_ann.expr,
@ -773,7 +774,7 @@ mod test_snapshots {
true
}
"parens_newlines_before_as" => {
"parens_newlines_before_as" | "tag_union_ann_with_as" => {
// Found unbound type variables {66}
// in type alias `Test.IdentId(0)` [] [] : <66>
// Location: crates/compiler/can/src/scope.rs:541:13