summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-objects-bugs/pr7284_bad.ml
blob: ab7bc55d82305ca391bc0810c3dba2630d319118 (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
38
39
40
41
(* TEST
flags = " -w -a "
ocamlc_byte_exit_status = "2"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
*)

module type S = sig

   type o1 = < bar : int; foo : int >
   type o2 = private < foo : int; .. >

   type v1 = T of o1
   type v2 = T of o2

 end

 module M = struct

   type o1 = < bar : int; foo : int >
   type o2 = o1

   type v1 = T of o1
   type v2 = v1 = T of o2

 end

 module F(X : S) = struct

   type 'a wit =
   | V1 : string -> X.v1 wit
   | V2 : int -> X.v2 wit

   let f : X.v1 wit -> unit = function V1 s -> print_endline s

 end [@@warning "+8"] [@@warnerror "+8"]

 module N = F(M)

 let () = N.f (N.V2 0)