Disallow eliding empty record destructure assignment if expr looks like an implements clause (fixes #7366)

This commit is contained in:
Joshua Warner 2024-12-13 20:19:18 -08:00
parent f86f440f2f
commit c54b01016e
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
7 changed files with 91 additions and 3 deletions

View file

@ -0,0 +1,54 @@
@0-18 SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-16,
],
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: [
Body(
@0-2 RecordDestructure(
[],
),
@3-16 Apply(
@3-4 Tag(
"O",
),
[
@4-6 Record(
[],
),
@6-16 Var {
module_name: "",
ident: "implements",
},
],
Space,
),
),
],
},
@17-18 SpaceBefore(
Var {
module_name: "",
ident: "a",
},
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,2 @@
{}=O{}implements
a

View file

@ -1,5 +1,5 @@
A implements
q : U
e
-> p
e
-> p
d