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

Commit

Permalink
Add outcome printer test for erasure of Js.t
Browse files Browse the repository at this point in the history
Follow-up of #291
  • Loading branch information
chenglou committed Mar 8, 2021
1 parent 98627c2 commit 9907b82
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
17 changes: 12 additions & 5 deletions tests/oprint/oprint.res
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ module Diff2 = Diff

type rec tree<'value> =
| Nil
| Node(tree<'value>, 'value, tree<'value>)
| Node(tree<'value>, 'value, tree<'value>)

type intTree = tree<int>

type rec tree2<'value> =
| Niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiil2
| Noooooooooooooooooooooooooooooooooooode2(tree2<'value>, 'value, tree2<'value>)
| Noooooooooooooooooooooooooooooooooooode2(tree2<'value>, 'value, tree2<'value>)

type rec tree3<'value> =
| Nil3
| Node3({left: tree3<'value>, value: 'value, right: tree3<'value>})
| Node3({left: tree3<'value>, value: 'value, right: tree3<'value>})

type rec tree4<'value> =
| Nil4
| Node4({leeeeeeeeeeeeeeeeeeeeeeeeeeeeft: tree3<'value>, vaaaaaaaaaaaaaaaaaaaaalue: 'value, riiiiiiiiiiiiiiiiiiiiiiight: tree3<'value>})
| Node4({leeeeeeeeeeeeeeeeeeeeeeeeeeeeft: tree3<'value>, vaaaaaaaaaaaaaaaaaaaaalue: 'value, riiiiiiiiiiiiiiiiiiiiiiight: tree3<'value>})

type color = ..

Expand Down Expand Up @@ -137,7 +137,7 @@ let computeAreaPlus = (sp: shapePlus) =>

let computeAreaExotic = (sp) =>
switch sp {
| #"R-Triangle+"(_p1, _p2, _p3) => ()
| #"R-Triangle+"(_p1, _p2, _p3) => ()
| #...shape as s => ignore(s); ()
}

Expand Down Expand Up @@ -201,6 +201,8 @@ type exoticUser = {
}

module Js = {
type t<'a> = 'a

module Fn = {
type arity0<'a> = {i0: unit => 'a}
type arity1<'a> = {i1: 'a}
Expand Down Expand Up @@ -253,3 +255,8 @@ type arity20 = Js.Fn.arity20<(int, int, int, int, int, int, int, int, int, int,
type arity21 = Js.Fn.arity21<(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) => int>
type arity22 = Js.Fn.arity22<(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) => int>

type obj1<'a> = option<Js.t<{"a": int}>>
type obj2 = Js.t<{"a": int}>
type obj3 = Js.t<{. "a": int}>
type obj4 = {"a": int}
type obj5<'a> = Js.t<{..} as 'a>
10 changes: 9 additions & 1 deletion tests/oprint/oprint.res.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ type \"type" = [#"Point🗿"(\"let", float)]
type t23 = [#"1" | #"10space" | #"123"]
type exoticUser = {\"let": string, \"type": float}
module Js = {
type t<'a> = 'a
module Fn = {
type arity0<'a> = {i0: unit => 'a}
type arity1<'a> = {i1: 'a}
Expand Down Expand Up @@ -397,4 +398,11 @@ type arity22 = (.
int,
int,
int,
) => int
) => int
type obj1<'a> = option<{"a": int}>
type obj2 = {"a": int}
type obj3 = {"a": int}
type obj4 = {"a": int}
type obj5<'a> = Js.t<'a>

constraint 'a = {..}

0 comments on commit 9907b82

Please sign in to comment.