diff --git a/crates/compiler/can/src/def.rs b/crates/compiler/can/src/def.rs index 187a9d6107..29fcf69b5b 100644 --- a/crates/compiler/can/src/def.rs +++ b/crates/compiler/can/src/def.rs @@ -2272,10 +2272,11 @@ fn canonicalize_pending_body<'a>( opt_loc_annotation: Option>, ) -> 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.)