Skip to content

Commit 2db6f9b

Browse files
committed
Fix issue with formatting comment on labelled argument in uncurried mode
Fixes #6094
1 parent 2ba635d commit 2db6f9b

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

jscomp/ml/ast_uncurried.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ let rec attributes_to_arity (attrs : Parsetree.attributes) =
5050
let uncurriedFun ~loc ~arity funExpr =
5151
Ast_helper.Exp.construct ~loc
5252
~attrs:(arity_to_attributes arity)
53-
{ txt = Lident "Function$"; loc }
53+
(Location.mknoloc (Longident.Lident "Function$"))
5454
(Some funExpr)
5555

5656
let exprIsUncurriedFun (expr : Parsetree.expression) =

res_syntax/tests/printer/expr/Uncurried.res

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,11 @@ let add3 = (x,y,z) => x+y+z
44

55
let triangle = 3 |> add3(1,2) |> add3(4,5)
66

7-
let () = 3 |> ignore
7+
let () = 3 |> ignore
8+
9+
let foo = (/* ddd */ x) => x
10+
11+
let f = (
12+
// comment
13+
~a,
14+
) => a

res_syntax/tests/printer/expr/expected/Uncurried.res.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ let add3 = (x, y, z) => x + y + z
55
let triangle = add3(4, 5, add3(1, 2, 3))
66

77
let () = ignore(3)
8+
9+
let foo = /* ddd */ x => x
10+
11+
let f = (
12+
// comment
13+
~a,
14+
) => a

0 commit comments

Comments
 (0)