summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-poly/pr7636.ml
blob: 1c4ef67ccb734f3d2312126e3a6b0b9ed43aa74a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(* TEST
 expect;
*)

module M = struct
  type ('a, 'b) elt = 'a

  type 'a iter = { f : 'b.('a, 'b) elt -> unit }

  let promote (f : 'a -> unit) =
    let f : 'b.('a, 'b) elt -> unit = fun x -> f x in
    { f }
end
[%%expect{|
module M :
  sig
    type ('a, 'b) elt = 'a
    type 'a iter = { f : 'b. 'a -> unit; }
    val promote : ('a -> unit) -> 'a iter
  end
|}]

module M' : sig
  type ('a, 'b) elt
  type 'a iter = { f : 'b.('a, 'b) elt -> unit }
end = M
[%%expect{|
module M' :
  sig type ('a, 'b) elt type 'a iter = { f : 'b. ('a, 'b) elt -> unit; } end
|}]

type 'a t = int
let test : 'a. int -> 'a t = fun i -> i;;
[%%expect{|
type 'a t = int
val test : int -> int = <fun>
|}]