summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-gadts/pr10735.ml
blob: 6202c3629e8c4988c5ab07110671e334947d6dfb (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
(* TEST
 expect;
*)

module X : sig
  type 'a t
end = struct
  type 'a t
end

type 'a t

type (_,_) eq = Refl : ('a,'a) eq
[%%expect{|
module X : sig type 'a t end
type 'a t
type (_, _) eq = Refl : ('a, 'a) eq
|}]

let () =
  let (Refl : (bool X.t, bool t) eq) as t = Obj.magic  () in ()
[%%expect{|
Line 2, characters 7-11:
2 |   let (Refl : (bool X.t, bool t) eq) as t = Obj.magic  () in ()
           ^^^^
Error: This pattern matches values of type (bool X.t, bool X.t) eq
       but a pattern was expected which matches values of type
         (bool X.t, bool t) eq
       Type bool X.t is not compatible with type bool t
|}]