blob: 9646d3d0a597a2fe0efb25b0eefa86ddb5b396e6 (
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
|
# 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.
# Characters 121-124:
module type S = sig exception Foo of int exception Foo of bool end;;
^^^
Error: Multiple definition of the extension constructor name Foo.
Names must be unique in a given structure or signature.
# module F : functor (X : sig end) -> sig val x : int end
# Characters 0-3:
F.x;; (* fail *)
^^^
Error: The module F is a functor, not a structure
#
|