mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-19 12:35:07 +00:00
Don't remove empty record assignment if body looks like an expect
This commit is contained in:
parent
a1d61c5a3c
commit
d82accf83d
5 changed files with 70 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
|||
{} = expect! w
|
||||
0
|
|
@ -0,0 +1,51 @@
|
|||
@0-13 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-11,
|
||||
],
|
||||
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-11 Apply(
|
||||
@3-10 Var {
|
||||
module_name: "",
|
||||
ident: "expect!",
|
||||
},
|
||||
[
|
||||
@10-11 Var {
|
||||
module_name: "",
|
||||
ident: "w",
|
||||
},
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@12-13 SpaceBefore(
|
||||
Num(
|
||||
"0",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
{}=expect!w
|
||||
0
|
|
@ -391,6 +391,7 @@ mod test_snapshots {
|
|||
pass/empty_package_header.header,
|
||||
pass/empty_platform_header.header,
|
||||
pass/empty_record.expr,
|
||||
pass/empty_record_assign_expect_bang.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