Skip to content

Commit

Permalink
fix(parser): don't add unit argument if arity0 partial application
Browse files Browse the repository at this point in the history
  • Loading branch information
glennsl committed Jul 8, 2023
1 parent e8e1a3d commit d50f2e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jscomp/syntax/src/res_core.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3612,7 +3612,7 @@ and parseCallExpr p funExpr =
Parser.expect Rparen p;
let args =
match args with
| [] ->
| [] when not isPartial ->
let loc = mkLoc startPos p.prevEndPos in
(* No args -> unit sugar: `foo()` *)
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,5 @@ type nonrec callback2 =
(ReactEvent.Mouse.t -> unit as 'u, [ `Has_arity1 ]) function$
type nonrec callback3 =
(ReactEvent.Mouse.t -> unit, [ `Has_arity1 ]) function$ as 'callback
let partialPipe = x |.u ((f ())[@res.partial ][@res.uapp ])
let partialPipe = x |.u f
let partialPipe2 = x |.u ((f y)[@res.partial ][@res.uapp ])

0 comments on commit d50f2e0

Please sign in to comment.