Skip to content

Commit 32524e3

Browse files
committed
keep arg labels
1 parent b14f06b commit 32524e3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/ml/typecore.ml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3572,7 +3572,7 @@ and translate_unified_ops (env : Env.t) (funct : Typedtree.expression)
35723572
| Texp_ident (path, _, _) -> (
35733573
let entry = Hashtbl.find_opt Unified_ops.index_by_path (Path.name path) in
35743574
match (entry, sargs) with
3575-
| Some {form = Unary; specialization; _}, [(Nolabel, lhs_expr)] ->
3575+
| Some {form = Unary; specialization; _}, [(lhs_label, lhs_expr)] ->
35763576
let lhs = type_exp env lhs_expr in
35773577
let lhs_type = expand_head env lhs.exp_type in
35783578
let result_type =
@@ -3595,10 +3595,10 @@ and translate_unified_ops (env : Env.t) (funct : Typedtree.expression)
35953595
unify env lhs_type Predef.type_int;
35963596
Predef.type_int
35973597
in
3598-
let targs = [(Nolabel, Some lhs)] in
3598+
let targs = [(lhs_label, Some lhs)] in
35993599
Some (targs, result_type)
36003600
| ( Some {form = Binary; specialization; _},
3601-
[(Nolabel, lhs_expr); (Nolabel, rhs_expr)] ) ->
3601+
[(lhs_label, lhs_expr); (rhs_label, rhs_expr)] ) ->
36023602
let lhs = type_exp env lhs_expr in
36033603
let lhs_type = expand_head env lhs.exp_type in
36043604
let rhs = type_exp env rhs_expr in
@@ -3648,12 +3648,12 @@ and translate_unified_ops (env : Env.t) (funct : Typedtree.expression)
36483648
let lhs = type_expect env lhs_expr Predef.type_string in
36493649
(lhs, rhs, Predef.type_string)
36503650
| _ ->
3651-
(* Rule 2. Fallback to int *)
3651+
(* Rule 3. Fallback to int *)
36523652
let lhs = type_expect env lhs_expr Predef.type_int in
36533653
let rhs = type_expect env rhs_expr Predef.type_int in
36543654
(lhs, rhs, Predef.type_int))
36553655
in
3656-
let targs = [(Nolabel, Some lhs); (Nolabel, Some rhs)] in
3656+
let targs = [(lhs_label, Some lhs); (rhs_label, Some rhs)] in
36573657
Some (targs, result_type)
36583658
| _ -> None)
36593659
| _ -> None

0 commit comments

Comments
 (0)