summaryrefslogtreecommitdiff
path: root/testsuite/tests/warnings/w32.ml
blob: cbb1630e61c8d2e63eb8c08638fc4e955fd96c31 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
(* TEST_BELOW
(* Blank lines added here to preserve locations. *)









*)

(* from MPR#7624 *)

let[@warning "-32"] f x = x

let g x = x

let h x = x


(* multiple bindings *)

let[@warning "-32"] i x = x
and j x = x

let k x = x
and[@warning "-32"] l x = x

let[@warning "-32"] m x = x
and n x = x

let o x = x
and[@warning "-32"] p x = x


(* recursive bindings *)

let[@warning "-32"] rec q x = x
and r x = x

let[@warning "-32"] rec s x = x
and[@warning "-39"] t x = x

let[@warning "-39"] rec u x = x
and v x = v x


(* disabled then re-enabled warnings *)

module M = struct
  [@@@warning "-32"]
  let f x = x
  let[@warning "+32"] g x = x
  let[@warning "+32"] h x = x
  and i x = x
  let j x = x
  and[@warning "+32"] k x = x
end

(* unused values in functor argument *)
module F (X : sig val x : int end) = struct end

module G (X : sig val x : int end) = X

module H (X : sig val x : int end) = X

module type S = sig
  module F:  sig val x : int end -> sig end
end

(* TEST
 flags = "-w +A";
 setup-ocamlc.byte-build-env;
 module = "w32.mli";
 ocamlc.byte;
 module = "w32.ml";
 ocamlc.byte;
 check-ocamlc.byte-output;
*)