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

Issues with outcome printer and arity0 #512

Merged
merged 2 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/res_outcome_printer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ let printPolyVarIdent txt =
]
| Otyp_constr (
Oide_dot (Oide_dot (Oide_ident "Js", "Fn") , "arity0"), (* Js.Fn.arity0 *)
[Otyp_constr (Oide_ident ident, [])] (* int or unit or string *)
[typ]
) ->
(* Js.Fn.arity0<int> -> (.) => int*)
(* Js.Fn.arity0<t> -> (.) => t *)
Doc.concat [
Doc.text "(.) => ";
Doc.text ident;
printOutTypeDoc typ;
]
| Otyp_constr (
Oide_dot (Oide_dot (Oide_ident "Js", "Fn") , ident), (* Js.Fn.arity2 *)
Expand Down
2 changes: 2 additions & 0 deletions tests/oprint/expected/oprint.resi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ module Js: {
}
type arity0 = (.) => unit
type arity0b = (.) => int
type arity0c = (.) => (.) => array<int>
type arity0d = (.) => unit => unit
type arity1 = (. int) => int
type arity2 = (. int, int) => int
type arity3 = (. int, int, int) => int
Expand Down
3 changes: 3 additions & 0 deletions tests/oprint/oprint.res
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ module Js = {

type arity0 = Js.Fn.arity0<unit>
type arity0b = Js.Fn.arity0<int>
type arity0c = Js.Fn.arity0<Js.Fn.arity0<array<int>>>
type arity0d = Js.Fn.arity0<unit => unit>
type arity1 = Js.Fn.arity1<(int) => int>
type arity2 = Js.Fn.arity2<(int, int) => int>
type arity3 = Js.Fn.arity3<(int, int, int) => int>
Expand Down Expand Up @@ -340,3 +342,4 @@ let f = (~x=?, ~y as _) => x
type call = CleanStart

let f = (~a=1) => 1