summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-modules/Test.ml.principal.reference
blob: 8e993fa3aa353601c1d721f8215ea2a7e10d9907 (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

#     module type S = sig type t and s = t end
# module type S' = sig type s = int end
#   module type S = sig module rec M : sig  end and N : sig  end end
# module type S' = sig module rec N : sig  end end
#     * * * * * * * * * * * * * * * *         type -'a t
class type c = object method m : [ `A ] t end
#   module M : sig val v : (#c as 'a) -> 'a end
#       val id : 'a -> 'a = <fun>
#       val ko : 'a -> unit = <fun>
#           Characters 64-99:
    struct type +'a t = private int end
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Signature mismatch:
       Modules do not match:
         sig type +'a t = private int end
       is not included in
         sig type -'a t = private int end
       Type declarations do not match:
         type +'a t = private int
       is not included in
         type -'a t = private int
       Their variances do not agree.
#       module type A = sig type t = X of int end
# type u = X of bool
# Characters 23-33:
  module type B = A with type t = u;; (* fail *)
                         ^^^^^^^^^^
Error: This variant or record definition does not match that of type u
       The types for field X are not equal.
#       module type S = sig exception Foo of bool end
#