mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-24 12:32:29 +00:00
Unwrap expr in loop
This commit is contained in:
parent
29592ddb9b
commit
3ccb6114b2
1 changed files with 5 additions and 4 deletions
|
@ -2272,10 +2272,11 @@ fn canonicalize_pending_body<'a>(
|
|||
|
||||
opt_loc_annotation: Option<Loc<crate::annotation::Annotation>>,
|
||||
) -> DefOutput {
|
||||
let loc_value = match &loc_expr.value {
|
||||
ast::Expr::ParensAround(loc_value) => loc_value,
|
||||
_ => &loc_expr.value,
|
||||
};
|
||||
let mut loc_value = &loc_expr.value;
|
||||
|
||||
while let ast::Expr::ParensAround(value) = loc_value {
|
||||
loc_value = value;
|
||||
}
|
||||
|
||||
// We treat closure definitions `foo = \a, b -> ...` differently from other body expressions,
|
||||
// because they need more bookkeeping (for tail calls, closure captures, etc.)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue