mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
Make ann_pattern and ann_type references
This commit is contained in:
parent
b0e4f4c97f
commit
6c01d02de0
3 changed files with 7 additions and 7 deletions
|
@ -433,7 +433,7 @@ mod test_can {
|
||||||
|
|
||||||
assert_eq!(problems, Vec::new());
|
assert_eq!(problems, Vec::new());
|
||||||
}
|
}
|
||||||
|
|
||||||
// LOCALS
|
// LOCALS
|
||||||
|
|
||||||
// TODO rewrite this test to check only for UnusedDef reports
|
// TODO rewrite this test to check only for UnusedDef reports
|
||||||
|
|
|
@ -278,8 +278,8 @@ pub enum Def<'a> {
|
||||||
Body(&'a Loc<Pattern<'a>>, &'a Loc<Expr<'a>>),
|
Body(&'a Loc<Pattern<'a>>, &'a Loc<Expr<'a>>),
|
||||||
|
|
||||||
AnnotatedBody {
|
AnnotatedBody {
|
||||||
ann_pattern: Loc<Pattern<'a>>,
|
ann_pattern: &'a Loc<Pattern<'a>>,
|
||||||
ann_type: Loc<TypeAnnotation<'a>>,
|
ann_type: &'a Loc<TypeAnnotation<'a>>,
|
||||||
comment: Option<&'a str>,
|
comment: Option<&'a str>,
|
||||||
body_pattern: &'a Loc<Pattern<'a>>,
|
body_pattern: &'a Loc<Pattern<'a>>,
|
||||||
body_expr: &'a Loc<Expr<'a>>,
|
body_expr: &'a Loc<Expr<'a>>,
|
||||||
|
|
|
@ -516,8 +516,8 @@ fn to_def<'a>(
|
||||||
(ann_pattern, ann_type),
|
(ann_pattern, ann_type),
|
||||||
Some((opt_comment, (body_pattern, body_expr))),
|
Some((opt_comment, (body_pattern, body_expr))),
|
||||||
)) => Def::AnnotatedBody {
|
)) => Def::AnnotatedBody {
|
||||||
ann_pattern,
|
ann_pattern: arena.alloc(ann_pattern),
|
||||||
ann_type,
|
ann_type: arena.alloc(ann_type),
|
||||||
comment: opt_comment,
|
comment: opt_comment,
|
||||||
body_pattern: arena.alloc(body_pattern),
|
body_pattern: arena.alloc(body_pattern),
|
||||||
body_expr: arena.alloc(body_expr),
|
body_expr: arena.alloc(body_expr),
|
||||||
|
@ -854,8 +854,8 @@ fn parse_def_signature<'a>(
|
||||||
Region::span_across(&loc_first_pattern.region, &body_expr.region);
|
Region::span_across(&loc_first_pattern.region, &body_expr.region);
|
||||||
Located {
|
Located {
|
||||||
value: Def::AnnotatedBody {
|
value: Def::AnnotatedBody {
|
||||||
ann_pattern: loc_first_pattern,
|
ann_pattern: arena.alloc(loc_first_pattern),
|
||||||
ann_type: loc_first_annotation,
|
ann_type: arena.alloc(loc_first_annotation),
|
||||||
comment: opt_comment,
|
comment: opt_comment,
|
||||||
body_pattern: arena.alloc(body_pattern),
|
body_pattern: arena.alloc(body_pattern),
|
||||||
body_expr: arena.alloc(body_expr),
|
body_expr: arena.alloc(body_expr),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue