Fix where precedence vs apply

This commit is contained in:
Joshua Warner 2025-01-01 13:52:37 -05:00
parent ea7d856e16
commit 6fcc367af4
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 67 additions and 1 deletions

View file

@ -0,0 +1,2 @@
1 : A (* where e implements J) *
l

View file

@ -0,0 +1,61 @@
@0-30 SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-28,
],
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-28 Apply(
"",
"A",
[
@4-25 Where(
@4-5 Wildcard,
[
@11-25 ImplementsClause {
var: @11-12 "e",
abilities: [
@24-25 Apply(
"",
"J",
[],
),
],
},
],
),
@27-28 Wildcard,
],
),
),
],
},
@29-30 SpaceBefore(
Var {
module_name: "",
ident: "l",
},
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,2 @@
1:A(*where e implements J) *
l

View file

@ -783,6 +783,7 @@ mod test_snapshots {
pass/where_clause_on_newline.expr,
pass/where_ident.expr,
pass/where_in_tuple_after_comment.expr,
pass/where_in_tuple_plain.expr,
pass/zero_float.expr,
pass/zero_int.expr,
// END SNAPSHOTS (for automatic test detection via `env ROC_SNAPSHOT_TEST_OVERWRITE=1 cargo test`)