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

type 'a t =
  | A: [`a|`z] t
  | B: [`b|`z] t
;;
[%%expect{|
type 'a t = A : [ `a | `z ] t | B : [ `b | `z ] t
|}];;

let fn: type a. a t -> a -> int = fun x y ->
  match (x, y) with
  | (A, `a)
  | (B, `b) -> 0
  | (A, `z)
  | (B, `z) -> 1
;;
[%%expect{|
val fn : 'a t -> 'a -> int = <fun>
|}];;