summaryrefslogtreecommitdiff
path: root/testsuite/tests/ppx-attributes/warning.ml
blob: 0ae6667472447ecba4b861f31e16abe9b862c784 (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
(* TEST
*)

[@@@ocaml.warning "@A"]
[@@@ocaml.alert "++all"]

(* Fixture *)

module type DEPRECATED = sig end
[@@ocaml.deprecated]

module T = struct
  type deprecated
  [@@ocaml.deprecated]
end

(* Structure items *)

let _ = let x = 1 in ()
[@@ocaml.warning "-26"]

include (struct let _ = let x = 1 in () end)
[@@ocaml.warning "-26"]

module A = struct let _ = let x = 1 in () end
[@@ocaml.warning "-26"]

module rec B : sig type t end = struct type t = T.deprecated end
[@@ocaml.alert "-deprecated"]

module type T = sig type t = T.deprecated end
[@@ocaml.alert "-deprecated"]

(* Signature items *)

module type S = sig
  val x : T.deprecated
  [@@ocaml.alert "-deprecated"]

  module AA : sig type t = T.deprecated end
  [@@ocaml.alert "-deprecated"]

  module rec BB : sig type t = T.deprecated end
  [@@ocaml.alert "-deprecated"]

  module type T = sig type t = T.deprecated end
  [@@ocaml.alert "-deprecated"]

  include DEPRECATED
  [@@ocaml.alert "-deprecated"]
end