mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Fix where precedence vs funcs
This commit is contained in:
parent
b7ab25ee2e
commit
35ffbcd16b
5 changed files with 93 additions and 1 deletions
|
@ -1217,7 +1217,7 @@ impl<'a> Nodify<'a> for TypeAnnotation<'a> {
|
||||||
},
|
},
|
||||||
after: last_after,
|
after: last_after,
|
||||||
needs_indent,
|
needs_indent,
|
||||||
prec: Prec::AsType,
|
prec: Prec::FunctionType,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
x :
|
||||||
|
(a where e
|
||||||
|
implements K)
|
||||||
|
-> Z
|
||||||
|
s
|
|
@ -0,0 +1,81 @@
|
||||||
|
@0-31 SpaceAfter(
|
||||||
|
Defs(
|
||||||
|
Defs {
|
||||||
|
tags: [
|
||||||
|
EitherIndex(2147483648),
|
||||||
|
],
|
||||||
|
regions: [
|
||||||
|
@0-29,
|
||||||
|
],
|
||||||
|
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: "x",
|
||||||
|
},
|
||||||
|
@3-28 Function(
|
||||||
|
[
|
||||||
|
@3-25 Where(
|
||||||
|
@3-4 SpaceAfter(
|
||||||
|
BoundVariable(
|
||||||
|
"a",
|
||||||
|
),
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
[
|
||||||
|
@11-25 ImplementsClause {
|
||||||
|
var: @11-12 SpaceBefore(
|
||||||
|
SpaceAfter(
|
||||||
|
"e",
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
abilities: [
|
||||||
|
@24-25 Apply(
|
||||||
|
"",
|
||||||
|
"K",
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
Pure,
|
||||||
|
@27-28 Apply(
|
||||||
|
"",
|
||||||
|
"Z",
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
@30-31 SpaceBefore(
|
||||||
|
Var {
|
||||||
|
module_name: "",
|
||||||
|
ident: "s",
|
||||||
|
},
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
)
|
|
@ -0,0 +1,5 @@
|
||||||
|
x:(a
|
||||||
|
where
|
||||||
|
e
|
||||||
|
implements K->Z)
|
||||||
|
s
|
|
@ -301,6 +301,7 @@ mod test_snapshots {
|
||||||
pass/ann_effectful_fn.expr,
|
pass/ann_effectful_fn.expr,
|
||||||
pass/ann_open_union.expr,
|
pass/ann_open_union.expr,
|
||||||
pass/ann_parens_comments.expr,
|
pass/ann_parens_comments.expr,
|
||||||
|
pass/ann_parens_where_implements_func.expr,
|
||||||
pass/ann_pattern_comment_before_body.expr,
|
pass/ann_pattern_comment_before_body.expr,
|
||||||
pass/ann_record_pat_with_comment.expr,
|
pass/ann_record_pat_with_comment.expr,
|
||||||
pass/ann_tag_union_newline_comment.expr,
|
pass/ann_tag_union_newline_comment.expr,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue