Implement lifting for abilities

This commit is contained in:
Joshua Warner 2025-01-01 09:35:01 -05:00
parent 4da6bb0be6
commit 7fd97dec72
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 90 additions and 10 deletions

View file

@ -0,0 +1,4 @@
S implements i : a #
#
0

View file

@ -0,0 +1,58 @@
@0-24 SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(0),
],
regions: [
@0-22,
],
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 "i",
typ: @16-17 SpaceAfter(
BoundVariable(
"a",
),
[
LineComment(
"",
),
LineComment(
"",
),
],
),
},
],
},
],
value_defs: [],
},
@23-24 SpaceBefore(
Num(
"0",
),
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,4 @@
S implements i:(a#
#
)
0

View file

@ -458,6 +458,7 @@ mod test_snapshots {
pass/if_in_record_field_opt_pat.expr,
pass/if_newline_then_negate_else_recordupdater.expr,
pass/if_then_weird_indent.expr,
pass/implements_annotation_comment.expr,
pass/implements_in_pat_after_comment.expr,
pass/implements_newline_in_fn_ty.expr,
pass/implements_newlines_comments.expr,