blob: 1c908d781d54a8dcb5e2c0b2d94e1438073b2e60 (
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>
|}];;
|