summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-unboxed-types/test.ml.reference-noflat
blob: 4ef517ba99d9fbff904b551ca5c6dbda31fbf56f (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

#       type t1 = A of string [@@unboxed]
#       - : bool = true
#     type t2 = { f : string; } [@@unboxed]
#       - : bool = true
#     type t3 = B of { g : string; } [@@unboxed]
#       - : bool = true
#     Characters 29-58:
  type t4 = C [@@ocaml.unboxed];;  (* no argument *)
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This type cannot be unboxed because its constructor has no argument.
# Characters 0-45:
  type t5 = D of int * string [@@ocaml.unboxed];; (* more than one argument *)
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This type cannot be unboxed because
       its constructor has more than one argument.
# Characters 0-33:
  type t5 = E | F [@@ocaml.unboxed];;          (* more than one constructor *)
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This type cannot be unboxed because it has more than one constructor.
# Characters 0-40:
  type t6 = G of int | H [@@ocaml.unboxed];;
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This type cannot be unboxed because it has more than one constructor.
# Characters 0-51:
  type t7 = I of string | J of bool [@@ocaml.unboxed];;
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This type cannot be unboxed because it has more than one constructor.
#   Characters 1-50:
  type t8 = { h : bool; i : int } [@@ocaml.unboxed];;  (* more than one field *)
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This type cannot be unboxed because it has more than one field.
# Characters 0-56:
  type t9 = K of { j : string; l : int } [@@ocaml.unboxed];;
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This type cannot be unboxed because
       its constructor has more than one argument.
#     type t10 = A of t10 [@@unboxed]
# Characters 12-15:
  let rec x = A x;;
              ^^^
Error: This kind of expression is not allowed as right-hand side of `let rec'
#             Characters 121-172:
  ......struct
    type t = A of string [@@ocaml.unboxed]
  end..
Error: Signature mismatch:
       Modules do not match:
         sig type t = A of string [@@unboxed] end
       is not included in
         sig type t = A of string end
       Type declarations do not match:
         type t = A of string [@@unboxed]
       is not included in
         type t = A of string
       Their internal representations differ:
       the first declaration uses unboxed representation.
#           Characters 63-96:
  ......struct
    type t = A of string
  end..
Error: Signature mismatch:
       Modules do not match:
         sig type t = A of string end
       is not included in
         sig type t = A of string [@@unboxed] end
       Type declarations do not match:
         type t = A of string
       is not included in
         type t = A of string [@@unboxed]
       Their internal representations differ:
       the second declaration uses unboxed representation.
#           Characters 48-102:
  ......struct
    type t = { f : string } [@@ocaml.unboxed]
  end..
Error: Signature mismatch:
       Modules do not match:
         sig type t = { f : string; } [@@unboxed] end
       is not included in
         sig type t = { f : string; } end
       Type declarations do not match:
         type t = { f : string; } [@@unboxed]
       is not included in
         type t = { f : string; }
       Their internal representations differ:
       the first declaration uses unboxed representation.
#           Characters 66-102:
  ......struct
    type t = { f : string }
  end..
Error: Signature mismatch:
       Modules do not match:
         sig type t = { f : string; } end
       is not included in
         sig type t = { f : string; } [@@unboxed] end
       Type declarations do not match:
         type t = { f : string; }
       is not included in
         type t = { f : string; } [@@unboxed]
       Their internal representations differ:
       the second declaration uses unboxed representation.
#           Characters 53-112:
  ......struct
    type t = A of { f : string } [@@ocaml.unboxed]
  end..
Error: Signature mismatch:
       Modules do not match:
         sig type t = A of { f : string; } [@@unboxed] end
       is not included in
         sig type t = A of { f : string; } end
       Type declarations do not match:
         type t = A of { f : string; } [@@unboxed]
       is not included in
         type t = A of { f : string; }
       Their internal representations differ:
       the first declaration uses unboxed representation.
#           Characters 71-112:
  ......struct
    type t = A of { f : string }
  end..
Error: Signature mismatch:
       Modules do not match:
         sig type t = A of { f : string; } end
       is not included in
         sig type t = A of { f : string; } [@@unboxed] end
       Type declarations do not match:
         type t = A of { f : string; }
       is not included in
         type t = A of { f : string; } [@@unboxed]
       Their internal representations differ:
       the second declaration uses unboxed representation.
#       type t11 = L of float [@@unboxed]
#     - : unit = ()
#       type 'a t12 = M of 'a t12 [@@unboxed]
# val f : int t12 array -> int t12 = <fun>
#     type t13 = A : 'a t12 -> t13 [@@unboxed]
#         type t14
# type t15 = A of t14 [@@unboxed]
#     type 'a abs
# type t16 = A : 'a abs -> t16 [@@unboxed]
#     type t18 = A : 'a list abs -> t18 [@@unboxed]
#   *               Characters 176-256:
  ......struct
    type t = A of float [@@ocaml.unboxed]
    type u = { f1 : t; f2 : t }
  end..
Error: Signature mismatch:
       ...
       Type declarations do not match:
         type u = { f1 : t; f2 : t; }
       is not included in
         type u = { f1 : t; f2 : t; }
       Their internal representations differ:
       the first declaration uses unboxed float representation.
#     * *           module T : sig type t [@@immediate] end
#   *   type 'a s = S : 'a -> 'a s [@@unboxed]
# type t = T : 'a s -> t [@@unboxed]
#     type 'a s = S : 'a -> 'a option s [@@unboxed]
# type t = T : 'a s -> t [@@unboxed]
#                 module M :
  sig type 'a r constraint 'a = unit -> 'b val inj : 'b -> (unit -> 'b) r end
#     type t = T : (unit -> 'a) M.r -> t [@@unboxed]
#   type 'a s = S : (unit -> 'a) M.r -> 'a option s [@@unboxed]
#     type t = T : 'a s -> t [@@unboxed]
#     type 'a t = T : 'a s -> 'a t [@@unboxed]
#           type _ s = S : 'a t -> 'b s [@@unboxed]
and _ t = T : 'a -> 'a s t
#             type 'a s
type ('a, 'p) t = private 'a s
type 'a packed = T : ('a, 'b) t -> 'a packed [@@unboxed]
#         type f = { field : 'a. 'a list; } [@@unboxed]
# val g : f array =
  [|{field = []}; {field = []}; {field = []}; {field = []}; {field = []};
    {field = []}; {field = []}; {field = []}; {field = []}; {field = []}|]
# val h : f = {field = []}
#