mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Disallow eliding empty record destructure assignment if expr looks like an implements clause (fixes #7366)
This commit is contained in:
parent
f86f440f2f
commit
c54b01016e
7 changed files with 91 additions and 3 deletions
|
@ -0,0 +1,2 @@
|
|||
{} = O {} implements
|
||||
a
|
|
@ -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,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
{}=O{}implements
|
||||
a
|
|
@ -1,5 +1,5 @@
|
|||
A implements
|
||||
q : U
|
||||
e
|
||||
-> p
|
||||
e
|
||||
-> p
|
||||
d
|
|
@ -1,4 +1,4 @@
|
|||
S implements
|
||||
d : J
|
||||
m #
|
||||
m #
|
||||
D
|
|
@ -393,6 +393,7 @@ mod test_snapshots {
|
|||
pass/empty_platform_header.header,
|
||||
pass/empty_record.expr,
|
||||
pass/empty_record_assign_expect_bang.expr,
|
||||
pass/empty_record_assign_implements.expr,
|
||||
pass/empty_record_assign_return.expr,
|
||||
pass/empty_record_assign_tag.expr,
|
||||
pass/empty_record_assignment.expr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue