Skip to content

Commit 307aa3b

Browse files
committed
format
1 parent e3eecdc commit 307aa3b

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

compiler/syntax/src/res_core.ml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2560,15 +2560,15 @@ and over_parse_constrained_or_coerced_or_arrow_expression p expr =
25602560
( Ast_helper.Pat.var ~loc:expr.pexp_loc
25612561
(Location.mkloc
25622562
(Longident.flatten longident.txt |> String.concat ".")
2563-
longident.loc)
2564-
, false )
2565-
| Pexp_construct ({txt = Longident.Lident "()"} as lid, None) ->
2563+
longident.loc),
2564+
false )
2565+
| Pexp_construct (({txt = Longident.Lident "()"} as lid), None) ->
25662566
(Ast_helper.Pat.construct ~loc:expr.pexp_loc lid None, true)
25672567
(* TODO: can we convert more expressions to patterns?*)
25682568
| _ ->
25692569
( Ast_helper.Pat.var ~loc:expr.pexp_loc
2570-
(Location.mkloc "pattern" expr.pexp_loc)
2571-
, false )
2570+
(Location.mkloc "pattern" expr.pexp_loc),
2571+
false )
25722572
in
25732573
let arrow1 =
25742574
Ast_helper.Exp.fun_
@@ -2578,9 +2578,8 @@ and over_parse_constrained_or_coerced_or_arrow_expression p expr =
25782578
in
25792579
(* When the "expr" was `()`, the colon must apply to the return type, so
25802580
skip the ambiguity diagnostic and keep the parameter as unit. *)
2581-
if expr_is_unit then
2582-
arrow1
2583-
else (
2581+
if expr_is_unit then arrow1
2582+
else
25842583
let arrow2 =
25852584
Ast_helper.Exp.fun_
25862585
~loc:(mk_loc expr.pexp_loc.loc_start body.pexp_loc.loc_end)
@@ -2610,7 +2609,7 @@ and over_parse_constrained_or_coerced_or_arrow_expression p expr =
26102609
in
26112610
Parser.err ~start_pos:expr.pexp_loc.loc_start
26122611
~end_pos:body.pexp_loc.loc_end p (Diagnostics.message msg);
2613-
arrow1)
2612+
arrow1
26142613
| _ ->
26152614
let loc = mk_loc expr.pexp_loc.loc_start typ.ptyp_loc.loc_end in
26162615
let expr = Ast_helper.Exp.constraint_ ~loc expr typ in

0 commit comments

Comments
 (0)