mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Parenthesize closures in unary ops and pre-emptively disallow multi-backpassing in such closures, to avoid formatter trouble later
This commit is contained in:
parent
14b18f4213
commit
37e7caa1aa
12 changed files with 77 additions and 53 deletions
|
@ -267,7 +267,7 @@ fn format_expr_only(
|
|||
)
|
||||
|| (matches!(unary_op.value, called_via::UnaryOp::Negate)
|
||||
&& requires_space_after_unary(&lifted.item))
|
||||
|| (parens == Parens::InApply && ends_with_closure(&lifted.item));
|
||||
|| ends_with_closure(&lifted.item);
|
||||
|
||||
if needs_parens {
|
||||
// Unary negation can't be followed by whitespace (which is what a newline is) - so
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue