Fix ability with no newline after it

This commit is contained in:
Joshua Warner 2024-12-01 19:24:30 -08:00
parent b06afa7bb9
commit fa4d3e79ec
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
7 changed files with 119 additions and 51 deletions

View file

@ -1,2 +1,2 @@
t : (w -> p)ca
it
t : (w => p)a
t

View file

@ -1,54 +1,59 @@
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-10,
],
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 Identifier {
ident: "t",
},
@2-10 Tuple {
elems: [
@3-7 Function(
[
@3-4 BoundVariable(
"w",
SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-9,
],
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 Identifier {
ident: "t",
},
@2-9 Tuple {
elems: [
@3-7 Function(
[
@3-4 BoundVariable(
"w",
),
],
Effectful,
@6-7 BoundVariable(
"p",
),
],
Effectful,
@6-7 BoundVariable(
"p",
),
],
ext: Some(
@8-9 BoundVariable(
"a",
),
),
],
ext: Some(
@8-10 BoundVariable(
"ca",
),
),
},
),
],
},
@11-13 SpaceBefore(
Var {
module_name: "",
ident: "it",
},
),
],
},
[
Newline,
],
@10-11 SpaceBefore(
Var {
module_name: "",
ident: "t",
},
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,3 @@
S implements d : J
m #
D

View file

@ -0,0 +1,56 @@
Defs(
Defs {
tags: [
EitherIndex(0),
],
regions: [
@0-19,
],
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: [
Ability {
header: TypeHeader {
name: @0-1 "S",
vars: [],
},
loc_implements: @2-12 Implements,
members: [
AbilityMember {
name: @13-14 "d",
typ: @15-19 Apply(
"",
"J",
[
@18-19 SpaceBefore(
BoundVariable(
"m",
),
[
Newline,
],
),
],
),
},
],
},
],
value_defs: [],
},
@21-22 SpaceBefore(
Tag(
"D",
),
[
LineComment(
"",
),
],
),
)

View file

@ -0,0 +1,3 @@
S implements d:J
m#
D

View file

@ -493,6 +493,7 @@ mod test_snapshots {
pass/newline_in_type_def.expr,
pass/newline_inside_empty_list.expr,
pass/newline_singleton_list.expr,
pass/no_newline_after_implements.expr,
pass/nonempty_hosted_header.header,
pass/nonempty_package_header.header,
pass/nonempty_platform_header.header,