Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit b42a8ed

Browse files
committed
Arity 0 is not only for int.
Patch from @IwanKaramazow
1 parent fb2a21b commit b42a8ed

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/res_outcome_printer.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,12 @@ let printPolyVarIdent txt =
239239
]
240240
| Otyp_constr (
241241
Oide_dot (Oide_dot (Oide_ident "Js", "Fn") , "arity0"), (* Js.Fn.arity0 *)
242-
[Otyp_constr (Oide_ident ident, [])] (* int or unit or string *)
242+
[typ]
243243
) ->
244-
(* Js.Fn.arity0<int> -> (.) => int*)
244+
(* Js.Fn.arity0<t> -> (.) => t *)
245245
Doc.concat [
246246
Doc.text "(.) => ";
247-
Doc.text ident;
247+
printOutTypeDoc typ;
248248
]
249249
| Otyp_constr (
250250
Oide_dot (Oide_dot (Oide_ident "Js", "Fn") , ident), (* Js.Fn.arity2 *)

tests/oprint/expected/oprint.resi.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ module Js: {
179179
}
180180
type arity0 = (.) => unit
181181
type arity0b = (.) => int
182-
type arity0c = Js.Fn.arity0<Js.Fn.arity0<array<int>>>
183-
type arity0d = (. unit) => unit
182+
type arity0c = (.) => (.) => array<int>
183+
type arity0d = (.) => unit => unit
184184
type arity1 = (. int) => int
185185
type arity2 = (. int, int) => int
186186
type arity3 = (. int, int, int) => int

0 commit comments

Comments
 (0)