Implement better comparisons between alias and body

This commit is contained in:
Joshua Warner 2024-12-11 21:22:59 -08:00
parent 8b3abafa08
commit 07f7252573
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 87 additions and 5 deletions

View file

@ -0,0 +1,4 @@
B @A : w
#
@A = e
i

View file

@ -0,0 +1,66 @@
@0-14 SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(0),
EitherIndex(2147483648),
],
regions: [
@0-5,
@8-12,
],
space_before: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 2 },
],
space_after: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
Slice<roc_parse::ast::CommentOrNewline> { start: 2, length: 0 },
],
spaces: [
Newline,
LineComment(
"",
),
],
type_defs: [
Alias {
header: TypeHeader {
name: @0-1 "B",
vars: [
@1-3 OpaqueRef(
"@A",
),
],
},
ann: @4-5 BoundVariable(
"w",
),
},
],
value_defs: [
Body(
@8-10 OpaqueRef(
"@A",
),
@11-12 Var {
module_name: "",
ident: "e",
},
),
],
},
@13-14 SpaceBefore(
Var {
module_name: "",
ident: "i",
},
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,4 @@
B@A:w
#
@A=e
i

View file

@ -528,6 +528,7 @@ mod test_snapshots {
pass/opaque_comment_after_head.expr,
pass/opaque_destructure_first_item_in_body.expr,
pass/opaque_has_abilities.expr,
pass/opaque_in_ann_apply_arg.expr,
pass/opaque_reference_expr.expr,
pass/opaque_reference_expr_with_arguments.expr,
pass/opaque_reference_pattern.expr,