summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-gadts/pr5785.ml
blob: 9624adcdcbdb4b43c67075d60c440b9039ed0166 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Add (T : sig type two end) =
struct
  type _ t =
  | One : [`One] t
  | Two : T.two t

  let add (type a) : a t * a t -> string = function
    | One, One -> "two"
    | Two, Two -> "four"
end;;
[%%expect{|
Line _, characters 43-100:
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a case that is not matched:
(Two, One)
module Add :
  functor (T : sig type two end) ->
    sig
      type _ t = One : [ `One ] t | Two : T.two t
      val add : 'a t * 'a t -> string
    end
|}];;