summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-warnings/pr9244.ml
blob: 8fb319707efc21daeac882df4cc499e8b958430d (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
(* TEST
   flags = " -w +A "
   * expect
*)

module type U = sig end
[%%expect {|
module type U = sig end
|}]

module M : sig
  module F2 (_ : U) : U
end = struct
  module X = struct
    let x = 13
  end

  module F1 (_ : U) = X
  module F2 (M : U) = F1 (M)
end
[%%expect {|
Line 5, characters 8-9:
5 |     let x = 13
            ^
Warning 32 [unused-value-declaration]: unused value x.

module M : sig module F2 : U -> U end
|}]

module N : sig
  module F2 (_ : U) : U
end = struct
  module X = struct
    let x = 13
  end

  module F1 (_ : U) = X
  module F2 (_ : U) = F1 (struct end)
end
[%%expect {|
Line 5, characters 8-9:
5 |     let x = 13
            ^
Warning 32 [unused-value-declaration]: unused value x.

module N : sig module F2 : U -> U end
|}]


module F (X : sig type t type s end) = struct type t = X.t end
[%%expect {|
Line 1, characters 25-31:
1 | module F (X : sig type t type s end) = struct type t = X.t end
                             ^^^^^^
Warning 34 [unused-type-declaration]: unused type s.

module F : functor (X : sig type t type s end) -> sig type t = X.t end
|}]