summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-gadts/pr5848.ml
blob: d76ecff296788951bde11dee2c3dd50349fd80a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(* TEST
 expect;
*)

module B : sig
 type (_, _) t = Eq: ('a, 'a) t
 val f: 'a -> 'b -> ('a, 'b) t
end
=
struct
 type (_, _) t = Eq: ('a, 'a) t
 let f t1 t2 = Obj.magic Eq
end;;

let of_type: type a. a -> a = fun x ->
  match B.f x 4 with
  | Eq -> 5
;;
[%%expect{|
module B :
  sig type (_, _) t = Eq : ('a, 'a) t val f : 'a -> 'b -> ('a, 'b) t end
val of_type : 'a -> 'a = <fun>
|}];;