handle AnnotatedBody everywhere. It compiles now!

This commit is contained in:
Sébastien Besnier 2020-10-30 12:39:00 +01:00
parent d2d3681d7e
commit 014131dabe
6 changed files with 108 additions and 81 deletions

View file

@ -509,12 +509,9 @@ fn to_def<'a>(
Either::First((body_pattern, body_expr)) => {
Def::Body(arena.alloc(body_pattern), arena.alloc(body_expr))
}
Either::Second(((ann_pattern, ann_type), None)) => annotation_or_alias(
arena,
&ann_pattern.value,
ann_pattern.region,
ann_type,
),
Either::Second(((ann_pattern, ann_type), None)) => {
annotation_or_alias(arena, &ann_pattern.value, ann_pattern.region, ann_type)
}
Either::Second((
(ann_pattern, ann_type),
Some((opt_comment, (body_pattern, body_expr))),
@ -522,8 +519,8 @@ fn to_def<'a>(
ann_pattern: ann_pattern,
ann_type: ann_type,
comment: opt_comment,
body_pattern: body_pattern,
body_expr: body_expr,
body_pattern: arena.alloc(body_pattern),
body_expr: arena.alloc(body_expr),
},
}
}