Skip to content

Commit e3ae124

Browse files
committed
Update test output
1 parent 6483f51 commit e3ae124

File tree

5 files changed

+41
-10
lines changed

5 files changed

+41
-10
lines changed

ocaml/testsuite/tests/typing-layouts-float64/basics.ml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,17 @@ and 'a t5_11 = {x : 'a t5_10; y : 'a}
257257
type ('a : float64) t5_12 = {x : 'a; y : float#};;
258258
[%%expect{|
259259
type ('a : float64, 'b : float64) t5_9 = { x : 'a; y : 'b; z : 'a; }
260-
type ('a : float64) t5_10 = 'a t_float64_id
261-
and ('a : float64) t5_11 = { x : 'a t5_10; y : 'a; }
262-
type ('a : float64) t5_12 = { x : 'a; y : float#; }
260+
Line 4, characters 20-28:
261+
4 | and 'a t5_11 = {x : 'a t5_10; y : 'a}
262+
^^^^^^^^
263+
Error: Layout mismatch in final type declaration consistency check.
264+
This is most often caused by the fact that type inference is not
265+
clever enough to propagate layouts through variables in different
266+
declarations. It is also not clever enough to produce a good error
267+
message, so we'll say this instead:
268+
'a has layout float64, which does not overlap with value.
269+
The fix will likely be to add a layout annotation on a parameter to
270+
the declaration where this error is reported.
263271
|}];;
264272

265273
type ('a : float64) t5_13 = {x : 'a; y : float#};;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
File "unboxed_floats.ml", line 321, characters 25-31:
2-
321 | let ( let* ) x (f : _ -> float#) = f x
1+
File "unboxed_floats.ml", line 326, characters 25-31:
2+
326 | let ( let* ) x (f : _ -> float#) = f x
33
^^^^^^
4-
Error: This construct requires the beta version of the extension "layouts", which is disabled and cannot be used
4+
Error: This construct requires the stable version of the extension "layouts", which is disabled and cannot be used

ocaml/testsuite/tests/typing-layouts/annots.ml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,14 @@ type ('a : immediate) t_imm
329329
Line 3, characters 15-39:
330330
3 | type s = { f : ('a : value). 'a -> 'a u }
331331
^^^^^^^^^^^^^^^^^^^^^^^^
332-
Error: Type 'a has layout value, which is not a sublayout of immediate.
332+
Error: Layout mismatch in final type declaration consistency check.
333+
This is most often caused by the fact that type inference is not
334+
clever enough to propagate layouts through variables in different
335+
declarations. It is also not clever enough to produce a good error
336+
message, so we'll say this instead:
337+
'a has layout value, which is not a sublayout of immediate.
338+
The fix will likely be to add a layout annotation on a parameter to
339+
the declaration where this error is reported.
333340
|}]
334341
(* CR layouts v1.5: the location on that message is wrong. But it's hard
335342
to improve, because it comes from re-checking typedtree, where we don't

ocaml/testsuite/tests/typing-layouts/basics.ml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,14 @@ type ('a : immediate) t2_imm
13881388
Line 3, characters 15-40:
13891389
3 | type s = { f : ('a : value) . 'a -> 'a u }
13901390
^^^^^^^^^^^^^^^^^^^^^^^^^
1391-
Error: Type 'a has layout value, which is not a sublayout of immediate.
1391+
Error: Layout mismatch in final type declaration consistency check.
1392+
This is most often caused by the fact that type inference is not
1393+
clever enough to propagate layouts through variables in different
1394+
declarations. It is also not clever enough to produce a good error
1395+
message, so we'll say this instead:
1396+
'a has layout value, which is not a sublayout of immediate.
1397+
The fix will likely be to add a layout annotation on a parameter to
1398+
the declaration where this error is reported.
13921399
|}]
13931400

13941401
(****************************************************)

ocaml/testsuite/tests/typing-layouts/datatypes.ml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,17 @@ and t2 = Mk1 of t_float64 t | Mk2
317317
type 'a t8_5 = { x : 'a t8_6; y : string}
318318
and 'a t8_6 = 'a float64_t;;
319319
[%%expect {|
320-
type ('a : float64) t8_5 = { x : 'a t8_6; y : string; }
321-
and ('a : float64) t8_6 = 'a float64_t
320+
Line 1, characters 21-28:
321+
1 | type 'a t8_5 = { x : 'a t8_6; y : string}
322+
^^^^^^^
323+
Error: Layout mismatch in final type declaration consistency check.
324+
This is most often caused by the fact that type inference is not
325+
clever enough to propagate layouts through variables in different
326+
declarations. It is also not clever enough to produce a good error
327+
message, so we'll say this instead:
328+
'a has layout float64, which does not overlap with value.
329+
The fix will likely be to add a layout annotation on a parameter to
330+
the declaration where this error is reported.
322331
|}]
323332

324333

0 commit comments

Comments
 (0)