Skip to content

Commit 555ed36

Browse files
committed
Handle proper parens with uncurried anonymous function in pipes
1 parent 8100772 commit 555ed36

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

jscomp/syntax/src/res_parens.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ let flattenOperandRhs parentOperator rhs =
180180
let precParent = ParsetreeViewer.operatorPrecedence parentOperator in
181181
let precChild = ParsetreeViewer.operatorPrecedence operator in
182182
precParent >= precChild || rhs.pexp_attributes <> []
183+
| Pexp_construct ({ txt = Lident "Function$" }, Some _) -> true
183184
| Pexp_constraint ({pexp_desc = Pexp_pack _}, {ptyp_desc = Ptyp_package _}) ->
184185
false
185186
| Pexp_fun _ when ParsetreeViewer.isUnderscoreApplySugar rhs -> false

0 commit comments

Comments
 (0)