Fix AnnotatedBody desugaring

This commit is contained in:
Richard Feldman 2020-11-03 20:18:40 -05:00 committed by Sébastien Besnier
parent 6c01d02de0
commit 5f82372899

View file

@ -47,7 +47,19 @@ pub fn desugar_def<'a>(arena: &'a Bump, def: &'a Def<'a>) -> Def<'a> {
Nested(alias @ Alias { .. }) => Nested(alias),
ann @ Annotation(_, _) => Nested(ann),
Nested(ann @ Annotation(_, _)) => Nested(ann),
ann_body @ AnnotatedBody { .. } => Nested(ann_body),
AnnotatedBody {
ann_pattern,
ann_type,
comment,
body_pattern,
body_expr,
} => AnnotatedBody {
ann_pattern: ann_pattern,
ann_type: ann_type,
comment: *comment,
body_pattern: *body_pattern,
body_expr: desugar_expr(arena, body_expr),
},
Nested(ann_body @ AnnotatedBody { .. }) => Nested(ann_body),
Nested(NotYetImplemented(s)) => todo!("{}", s),
NotYetImplemented(s) => todo!("{}", s),