Skip to content

Commit f852f50

Browse files
accept tests
1 parent bbb6d5d commit f852f50

File tree

23 files changed

+117
-64
lines changed

23 files changed

+117
-64
lines changed

testsuite/tests/parsetree/source_jane_street.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,8 @@ type record =
450450
[%%expect{|
451451
type record = {
452452
global_ field0 : int;
453-
field1 : int @@ global portable contended;
454-
field2 : int @@ global portable contended;
453+
field1 : int @@ contended global portable;
454+
field2 : int @@ contended global portable;
455455
normal_field : int;
456456
}
457457
|}]
@@ -473,16 +473,16 @@ type t =
473473
[%%expect{|
474474
type 'a parameterized_record = {
475475
global_ field0 : 'a;
476-
field1 : 'a @@ global portable contended;
477-
field2 : 'a @@ global portable contended;
476+
field1 : 'a @@ contended global portable;
477+
field2 : 'a @@ contended global portable;
478478
normal_field : 'a;
479479
}
480480
type t =
481481
Foo of global_ int * int
482-
| Foo1 of int @@ global portable contended * int
483-
| Foo2 of global_ int * int @@ global portable contended
484-
| Foo3 of global_ int * int @@ portable contended
485-
| Foo4 of (int * int) @@ global portable contended
482+
| Foo1 of int @@ contended global portable * int
483+
| Foo2 of global_ int * int @@ contended global portable
484+
| Foo3 of global_ int * int @@ contended portable
485+
| Foo4 of (int * int) @@ contended global portable
486486
|}]
487487

488488
(* arrow types *)

testsuite/tests/typing-jkind-bounds/basics.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ type ('a : immediate) t : value mod global = { mutable x : 'a }
990990
Line 1, characters 0-63:
991991
1 | type ('a : immediate) t : value mod global = { mutable x : 'a }
992992
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
993-
Error: The kind of type "t" is mutable_data with 'a @@ many unyielding
993+
Error: The kind of type "t" is mutable_data with 'a @@ unyielding many
994994
because it's a boxed record type.
995995
But the kind of type "t" must be a subkind of value mod global
996996
because of the annotation on the declaration of the type t.
@@ -1004,7 +1004,7 @@ type ('a : immediate) t : value mod aliased = { mutable x : 'a }
10041004
Line 1, characters 0-64:
10051005
1 | type ('a : immediate) t : value mod aliased = { mutable x : 'a }
10061006
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1007-
Error: The kind of type "t" is mutable_data with 'a @@ many unyielding
1007+
Error: The kind of type "t" is mutable_data with 'a @@ unyielding many
10081008
because it's a boxed record type.
10091009
But the kind of type "t" must be a subkind of value mod aliased
10101010
because of the annotation on the declaration of the type t.
@@ -1018,7 +1018,7 @@ type ('a : immediate) t : value mod contended = { mutable x : 'a }
10181018
Line 1, characters 0-66:
10191019
1 | type ('a : immediate) t : value mod contended = { mutable x : 'a }
10201020
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1021-
Error: The kind of type "t" is mutable_data with 'a @@ many unyielding
1021+
Error: The kind of type "t" is mutable_data with 'a @@ unyielding many
10221022
because it's a boxed record type.
10231023
But the kind of type "t" must be a subkind of value mod contended
10241024
because of the annotation on the declaration of the type t.
@@ -1032,7 +1032,7 @@ type ('a : immediate) t : value mod external_ = { mutable x : 'a }
10321032
Line 1, characters 0-66:
10331033
1 | type ('a : immediate) t : value mod external_ = { mutable x : 'a }
10341034
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1035-
Error: The kind of type "t" is mutable_data with 'a @@ many unyielding
1035+
Error: The kind of type "t" is mutable_data with 'a @@ unyielding many
10361036
because it's a boxed record type.
10371037
But the kind of type "t" must be a subkind of value mod external_
10381038
because of the annotation on the declaration of the type t.
@@ -1046,7 +1046,7 @@ type ('a : immediate) t : value mod external64 = { mutable x : 'a }
10461046
Line 1, characters 0-67:
10471047
1 | type ('a : immediate) t : value mod external64 = { mutable x : 'a }
10481048
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1049-
Error: The kind of type "t" is mutable_data with 'a @@ many unyielding
1049+
Error: The kind of type "t" is mutable_data with 'a @@ unyielding many
10501050
because it's a boxed record type.
10511051
But the kind of type "t" must be a subkind of value mod external64
10521052
because of the annotation on the declaration of the type t.
@@ -1157,7 +1157,7 @@ Error: The kind of type "t" is value
11571157
type 'a t : value mod global portable contended many aliased unyielding =
11581158
{ x : 'a @@ global portable contended many aliased } [@@unboxed]
11591159
[%%expect {|
1160-
type 'a t = { x : 'a @@ global many aliased portable contended; } [@@unboxed]
1160+
type 'a t = { x : 'a @@ aliased contended global many portable; } [@@unboxed]
11611161
|}]
11621162
(* CR layouts v2.8: this could be accepted, if we infer ('a : value mod
11631163
unyielding). We do not currently do this, because we finish inference of the

testsuite/tests/typing-jkind-bounds/composite.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ Line 1, characters 13-20:
189189
1 | let foo (t : int ref t @ contended) = use_uncontended t
190190
^^^^^^^
191191
Error: This type "int ref" should be an instance of type "('a : immutable_data)"
192-
The kind of int ref is mutable_data with int @@ many unyielding.
192+
The kind of int ref is mutable_data with int @@ unyielding many.
193193
But the kind of int ref must be a subkind of immutable_data
194194
because of the definition of t at line 1, characters 0-46.
195195

@@ -341,7 +341,7 @@ Line 1, characters 13-20:
341341
1 | let foo (t : int ref t @ contended) = use_uncontended t
342342
^^^^^^^
343343
Error: This type "int ref" should be an instance of type "('a : immutable_data)"
344-
The kind of int ref is mutable_data with int @@ many unyielding.
344+
The kind of int ref is mutable_data with int @@ unyielding many.
345345
But the kind of int ref must be a subkind of immutable_data
346346
because of the definition of t at line 1, characters 0-73.
347347

testsuite/tests/typing-jkind-bounds/predef.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ type 'a t : mutable_data = 'a ref
176176
Line 1, characters 0-33:
177177
1 | type 'a t : mutable_data = 'a ref
178178
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
179-
Error: The kind of type "'a ref" is mutable_data with 'a @@ many unyielding.
179+
Error: The kind of type "'a ref" is mutable_data with 'a @@ unyielding many.
180180
But the kind of type "'a ref" must be a subkind of mutable_data
181181
because of the definition of t at line 1, characters 0-33.
182182

@@ -199,7 +199,7 @@ Line 1, characters 14-21:
199199
^^^^^^^
200200
Error: This type "int ref" should be an instance of type
201201
"('a : value mod portable)"
202-
The kind of int ref is mutable_data with int @@ many unyielding.
202+
The kind of int ref is mutable_data with int @@ unyielding many.
203203
But the kind of int ref must be a subkind of value mod portable
204204
because of the definition of require_portable at line 10, characters 0-47.
205205

@@ -223,7 +223,7 @@ Line 1, characters 14-21:
223223
^^^^^^^
224224
Error: This type "int ref" should be an instance of type
225225
"('a : value mod contended)"
226-
The kind of int ref is mutable_data with int @@ many unyielding.
226+
The kind of int ref is mutable_data with int @@ unyielding many.
227227
But the kind of int ref must be a subkind of value mod contended
228228
because of the definition of require_contended at line 9, characters 0-49.
229229

testsuite/tests/typing-jkind-bounds/printing.ml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ Lines 3-5, characters 6-3:
9090
5 | end
9191
Error: Signature mismatch:
9292
Modules do not match:
93-
sig type 'a t = Foo of 'a @@ many contended end
93+
sig type 'a t = Foo of 'a @@ contended many end
9494
is not included in
9595
sig type 'a t : immutable_data end
9696
Type declarations do not match:
97-
type 'a t = Foo of 'a @@ many contended
97+
type 'a t = Foo of 'a @@ contended many
9898
is not included in
9999
type 'a t : immutable_data
100-
The kind of the first is immutable_data with 'a @@ many contended
100+
The kind of the first is immutable_data with 'a @@ contended many
101101
because of the definition of t at line 4, characters 2-41.
102102
But the kind of the first must be a subkind of immutable_data
103103
because of the definition of t at line 2, characters 2-28.
@@ -179,7 +179,7 @@ Line 3, characters 11-12:
179179
^
180180
Error: This type "a" = "int ref" should be an instance of type
181181
"('a : immutable_data)"
182-
The kind of a is mutable_data with int @@ many unyielding.
182+
The kind of a is mutable_data with int @@ unyielding many.
183183
But the kind of a must be a subkind of immutable_data
184184
because of the definition of t at line 2, characters 0-28.
185185

@@ -343,15 +343,15 @@ Error: Signature mismatch:
343343
Modules do not match:
344344
sig type 'a t : mutable_data with 'a end
345345
is not included in
346-
sig type 'a t : mutable_data with 'a @@ many unyielding end
346+
sig type 'a t : mutable_data with 'a @@ unyielding many end
347347
Type declarations do not match:
348348
type 'a t : mutable_data with 'a
349349
is not included in
350-
type 'a t : mutable_data with 'a @@ many unyielding
350+
type 'a t : mutable_data with 'a @@ unyielding many
351351
The kind of the first is mutable_data with 'a
352352
because of the definition of t at line 4, characters 2-34.
353353
But the kind of the first must be a subkind of mutable_data
354-
with 'a @@ many unyielding
354+
with 'a @@ unyielding many
355355
because of the definition of t at line 2, characters 2-40.
356356

357357
The first mode-crosses less than the second along:
@@ -423,14 +423,14 @@ Lines 3-5, characters 6-3:
423423
5 | end
424424
Error: Signature mismatch:
425425
Modules do not match:
426-
sig type 'a t : mutable_data with 'a @@ many unyielding end
426+
sig type 'a t : mutable_data with 'a @@ unyielding many end
427427
is not included in
428428
sig type 'a t : immutable_data with 'a end
429429
Type declarations do not match:
430-
type 'a t : mutable_data with 'a @@ many unyielding
430+
type 'a t : mutable_data with 'a @@ unyielding many
431431
is not included in
432432
type 'a t : immutable_data with 'a
433-
The kind of the first is mutable_data with 'a @@ many unyielding
433+
The kind of the first is mutable_data with 'a @@ unyielding many
434434
because of the definition of t at line 4, characters 2-40.
435435
But the kind of the first must be a subkind of immutable_data with 'a
436436
because of the definition of t at line 2, characters 2-56.

testsuite/tests/typing-jkind-bounds/records.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ type 'a t : immutable_data = { mutable x : 'a }
128128
Line 1, characters 0-47:
129129
1 | type 'a t : immutable_data = { mutable x : 'a }
130130
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
131-
Error: The kind of type "t" is mutable_data with 'a @@ many unyielding
131+
Error: The kind of type "t" is mutable_data with 'a @@ unyielding many
132132
because it's a boxed record type.
133133
But the kind of type "t" must be a subkind of immutable_data
134134
because of the annotation on the declaration of the type t.
@@ -270,7 +270,7 @@ type 'a t : immutable_data with 'a = { mutable x : 'a }
270270
Line 1, characters 0-55:
271271
1 | type 'a t : immutable_data with 'a = { mutable x : 'a }
272272
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
273-
Error: The kind of type "t" is mutable_data with 'a @@ many unyielding
273+
Error: The kind of type "t" is mutable_data with 'a @@ unyielding many
274274
because it's a boxed record type.
275275
But the kind of type "t" must be a subkind of immutable_data with 'a
276276
because of the annotation on the declaration of the type t.

testsuite/tests/typing-jkind-bounds/subsumption/basics.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ Error: Signature mismatch:
176176
Modules do not match:
177177
sig type 'a t : mutable_data with 'a end
178178
is not included in
179-
sig type 'a t : mutable_data with 'a @@ many unyielding end
179+
sig type 'a t : mutable_data with 'a @@ unyielding many end
180180
Type declarations do not match:
181181
type 'a t : mutable_data with 'a
182182
is not included in
183-
type 'a t : mutable_data with 'a @@ many unyielding
183+
type 'a t : mutable_data with 'a @@ unyielding many
184184
The kind of the first is mutable_data with 'a
185185
because of the definition of t at line 4, characters 2-34.
186186
But the kind of the first must be a subkind of mutable_data
187-
with 'a @@ many unyielding
187+
with 'a @@ unyielding many
188188
because of the definition of t at line 2, characters 2-40.
189189

190190
The first mode-crosses less than the second along:
@@ -198,7 +198,7 @@ end = struct
198198
type 'a t : mutable_data with 'a @@ many unyielding
199199
end
200200
[%%expect {|
201-
module M : sig type 'a t : mutable_data with 'a @@ many unyielding end
201+
module M : sig type 'a t : mutable_data with 'a @@ unyielding many end
202202
|}]
203203

204204
(* CR layouts v2.8: 'a u's kind should get normalized to just immutable_data *)

testsuite/tests/typing-jkind-bounds/subsumption/constraint.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Error: Signature mismatch:
141141
type 'a t = Foo of 'a constraint 'a = 'b ref
142142
is not included in
143143
type 'a t : immutable_data with 'b constraint 'a = 'b ref
144-
The kind of the first is mutable_data with 'b @@ many unyielding
144+
The kind of the first is mutable_data with 'b @@ unyielding many
145145
because of the definition of t at line 4, characters 2-46.
146146
But the kind of the first must be a subkind of immutable_data with 'b
147147
because of the definition of t at line 2, characters 2-59.

testsuite/tests/typing-jkind-bounds/subsumption/functors.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Line 4, characters 0-48:
5959
4 | type 'a t : immutable_data with 'a = 'a F(Ref).t
6060
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6161
Error: The kind of type "'a F(Ref).t" is mutable_data
62-
with 'a @@ many unyielding
62+
with 'a @@ unyielding many
6363
because of the definition of t at line 2, characters 2-40.
6464
But the kind of type "'a F(Ref).t" must be a subkind of immutable_data
6565
with 'a
@@ -80,7 +80,7 @@ Line 4, characters 0-38:
8080
4 | type 'a t : mutable_data = 'a F(Ref).t
8181
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8282
Error: The kind of type "'a F(Ref).t" is mutable_data
83-
with 'a @@ many unyielding
83+
with 'a @@ unyielding many
8484
because of the definition of t at line 2, characters 2-40.
8585
But the kind of type "'a F(Ref).t" must be a subkind of mutable_data
8686
because of the definition of t at line 4, characters 0-38.

testsuite/tests/typing-jkind-bounds/subsumption/modalities.ml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,15 @@ Error: Signature mismatch:
269269
Modules do not match:
270270
sig type 'a t : immutable_data with 'a end
271271
is not included in
272-
sig type 'a t : immutable_data with 'a @@ portable contended end
272+
sig type 'a t : immutable_data with 'a @@ contended portable end
273273
Type declarations do not match:
274274
type 'a t : immutable_data with 'a
275275
is not included in
276-
type 'a t : immutable_data with 'a @@ portable contended
276+
type 'a t : immutable_data with 'a @@ contended portable
277277
The kind of the first is immutable_data with 'a
278278
because of the definition of t at line 4, characters 2-69.
279279
But the kind of the first must be a subkind of immutable_data
280-
with 'a @@ portable contended
280+
with 'a @@ contended portable
281281
because of the definition of t at line 2, characters 2-58.
282282

283283
The first mode-crosses less than the second along:
@@ -367,6 +367,21 @@ end = struct
367367
type 'a t : immutable_data with 'a @@ portable contended portable
368368
end
369369
[%%expect {|
370+
Line 4, characters 40-48:
371+
4 | type 'a t : immutable_data with 'a @@ portable contended portable
372+
^^^^^^^^
373+
Warning 213: This portability is overriden by meet_with(portable) later.
374+
375+
Line 4, characters 40-48:
376+
4 | type 'a t : immutable_data with 'a @@ portable contended portable
377+
^^^^^^^^
378+
Warning 213: This portability is overriden by meet_with(portable) later.
379+
380+
Line 4, characters 40-48:
381+
4 | type 'a t : immutable_data with 'a @@ portable contended portable
382+
^^^^^^^^
383+
Warning 213: This portability is overriden by meet_with(portable) later.
384+
370385
module M : sig type 'a t : immutable_data with 'a @@ portable end
371386
|}]
372387

0 commit comments

Comments
 (0)