File tree Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 1313# 11.1.4
1414
1515- Fix issue where long layout break added a trailing comma in partial application ` ... ` . https://github.com/rescript-lang/rescript-compiler/pull/6949
16+ - Fix incorrect format of function under unary operator. https://github.com/rescript-lang/rescript-compiler/pull/6953
1617
1718# 11.1.3
1819
Original file line number Diff line number Diff line change @@ -111,6 +111,11 @@ let unaryExprOperand expr =
111111 Parenthesized
112112 | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
113113 Parenthesized
114+ | {pexp_desc = Pexp_construct ({txt = Lident " Function$" }, Some expr)}
115+ when ParsetreeViewer. isUnderscoreApplySugar expr ->
116+ Nothing
117+ | {pexp_desc = Pexp_construct ({txt = Lident "Function$" } , Some _ )} ->
118+ Parenthesized
114119 | _ -> Nothing )
115120
116121let binaryExprOperand ~isLhs expr =
@@ -276,6 +281,11 @@ let fieldExpr expr =
276281 Parenthesized
277282 | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
278283 Parenthesized
284+ | {pexp_desc = Pexp_construct ({txt = Lident " Function$" }, Some expr)}
285+ when ParsetreeViewer. isUnderscoreApplySugar expr ->
286+ Nothing
287+ | {pexp_desc = Pexp_construct ({txt = Lident "Function$" } , Some _ )} ->
288+ Parenthesized
279289 | _ -> Nothing )
280290
281291let setFieldExprRhs expr =
Original file line number Diff line number Diff line change @@ -85,3 +85,5 @@ let () = {
8585
8686let x = (!truths)[0]
8787(!streets)[0] = "foo-street"
88+
89+ !(arg => doStuffWith(arg))
Original file line number Diff line number Diff line change @@ -68,3 +68,5 @@ let () = {
6868
6969let x = (! truths )[0 ]
7070(! streets )[0 ] = "foo-street"
71+
72+ ! (arg => doStuffWith (arg ))
You can’t perform that action at this time.
0 commit comments