ocaml/testsuite/tests/typing-gadts/pr5785.ml

11 lines
201 B
OCaml

module Add (T : sig type two end) =
struct
type _ t =
| One : [`One] t
| Two : T.two t
let add (type a) : a t * a t -> string = function
| One, One -> "two"
| Two, Two -> "four"
end;;