Skip to content

Commit eabfcee

Browse files
committed
Test bivariance
1 parent 96d5d71 commit eabfcee

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed

test/passing/refs.ahrefs/injectivity.ml.ref

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ type +!'a t = private 'a
1616

1717
type -!'a t = private 'a -> unit
1818

19+
type +-'a t = int
20+
type -+'a t = int
21+
22+
type !+-'a t = A
23+
type !-+'a t = A
24+
type +-!'a t = A
25+
type -+!'a t = A
26+
1927
module M : sig
2028
type +!'a t
2129
end = struct

test/passing/refs.default/injectivity.ml.ref

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ type +!'a t = private 'a
77
type -!'a t = private 'a -> unit
88
type +!'a t = private 'a
99
type -!'a t = private 'a -> unit
10+
type +-'a t = int
11+
type -+'a t = int
12+
type !+-'a t = A
13+
type !-+'a t = A
14+
type +-!'a t = A
15+
type -+!'a t = A
1016

1117
module M : sig
1218
type +!'a t

test/passing/refs.janestreet/injectivity.ml.ref

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ type +!'a t = private 'a
77
type -!'a t = private 'a -> unit
88
type +!'a t = private 'a
99
type -!'a t = private 'a -> unit
10+
type +-'a t = int
11+
type -+'a t = int
12+
type !+-'a t = A
13+
type !-+'a t = A
14+
type +-!'a t = A
15+
type -+!'a t = A
1016

1117
module M : sig
1218
type +!'a t

test/passing/refs.ocamlformat/injectivity.ml.ref

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ type +!'a t = private 'a
1616

1717
type -!'a t = private 'a -> unit
1818

19+
type +-'a t = int
20+
21+
type -+'a t = int
22+
23+
type !+-'a t = A
24+
25+
type !-+'a t = A
26+
27+
type +-!'a t = A
28+
29+
type -+!'a t = A
30+
1931
module M : sig
2032
type +!'a t
2133
end = struct

test/passing/tests/injectivity.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ type +!'a t = private 'a
1616

1717
type -!'a t = private 'a -> unit
1818

19+
type +-'a t = int
20+
type -+'a t = int
21+
22+
type !+-'a t = A
23+
type !-+'a t = A
24+
type +-!'a t = A
25+
type -+!'a t = A
26+
1927
module M : sig
2028
type +!'a t
2129
end = struct

0 commit comments

Comments
 (0)