@@ -41474,16 +41474,19 @@ and print_simple_out_type ppf =
4147441474 print_ident id
4147541475
4147641476 | Otyp_constr ((Oide_dot (Oide_ident "Js", ("fn" | "meth" as name )) as id) ,
41477- ([Otyp_variant(_,Ovar_fields [ _ , _, tys], _,_); result] as tyl))
41477+ ([Otyp_variant(_,Ovar_fields [ variant , _, tys], _,_); result] as tyl))
4147841478 ->
4147941479 (* Otyp_arrow*)
4148041480 let make tys result =
4148141481 if tys = [] then
4148241482 Otyp_arrow ("", Otyp_constr (Oide_ident "unit", []),result)
4148341483 else
41484- match tys with
41485- | [ Otyp_tuple tys] ->
41486- List.fold_right (fun x acc -> Otyp_arrow("",x,acc) ) tys result
41484+ match tys with
41485+ | [ Otyp_tuple tys as single] ->
41486+ if variant = "Arity_1" then
41487+ Otyp_arrow ("", single, result)
41488+ else
41489+ List.fold_right (fun x acc -> Otyp_arrow("",x,acc) ) tys result
4148741490 | [single] ->
4148841491 Otyp_arrow ("", single, result)
4148941492 | _ ->
@@ -41507,12 +41510,14 @@ and print_simple_out_type ppf =
4150741510 end
4150841511 end
4150941512 | Otyp_constr ((Oide_dot (Oide_ident "Js", "meth_callback" ) as id) ,
41510- ([Otyp_variant(_,Ovar_fields [ _ , _, tys], _,_); result] as tyl))
41513+ ([Otyp_variant(_,Ovar_fields [ variant , _, tys], _,_); result] as tyl))
4151141514 ->
4151241515 let make tys result =
4151341516 match tys with
41514- | [ Otyp_tuple tys] ->
41515- List.fold_right (fun x acc -> Otyp_arrow("",x,acc) ) tys result
41517+ | [ Otyp_tuple tys as single ] ->
41518+ if variant = "Arity_1" then Otyp_arrow ("", single, result)
41519+ else
41520+ List.fold_right (fun x acc -> Otyp_arrow("",x,acc) ) tys result
4151641521 | [single] ->
4151741522 Otyp_arrow ("", single, result)
4151841523 | _ ->
0 commit comments