Skip to content

Commit a5f002d

Browse files
committed
Remove one more Function$ from printer.
1 parent 2df3b30 commit a5f002d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/syntax/src/res_parens.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ let rhs_binary_expr_operand parent_operator rhs =
167167
| _ -> false
168168

169169
let flatten_operand_rhs parent_operator rhs =
170+
let rhs = Ast_uncurried.remove_fun rhs in
170171
match rhs.Parsetree.pexp_desc with
171172
| Parsetree.Pexp_apply
172173
( {
@@ -179,10 +180,8 @@ let flatten_operand_rhs parent_operator rhs =
179180
let prec_parent = ParsetreeViewer.operator_precedence parent_operator in
180181
let prec_child = ParsetreeViewer.operator_precedence operator in
181182
prec_parent >= prec_child || rhs.pexp_attributes <> []
182-
| Pexp_construct ({txt = Lident "Function$"}, Some _) -> true
183183
| Pexp_constraint ({pexp_desc = Pexp_pack _}, {ptyp_desc = Ptyp_package _}) ->
184184
false
185-
| Pexp_fun _ when ParsetreeViewer.is_underscore_apply_sugar rhs -> false
186185
| Pexp_fun _ | Pexp_newtype _ | Pexp_setfield _ | Pexp_constraint _ -> true
187186
| _ when ParsetreeViewer.is_ternary_expr rhs -> true
188187
| _ -> false

0 commit comments

Comments
 (0)