blob: 4c4abfd66673dd492ff95121e7d4ad3eabd38838 (
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
|
(* TEST
flags = "-w +A-70"
* setup-ocamlc.byte-build-env
** ocamlc.byte
compile_only = "true"
*** check-ocamlc.byte-output
*)
(** Test unused opens, in particular in presence of
pattern open *)
module M = struct end
module N = struct type t = A | B end
module R = struct type r = {x: int} end
let f M.(x) = x (* useless open *)
let g N.(A|B) = () (* used open *)
let h R.{x} = R.{x}
open N (* used open *)
let i (A|B) = B
open! M (* useless open! *)
open M (* useless open *)
|