File tree Expand file tree Collapse file tree 5 files changed +41
-10
lines changed Expand file tree Collapse file tree 5 files changed +41
-10
lines changed Original file line number Diff line number Diff line change @@ -257,9 +257,17 @@ and 'a t5_11 = {x : 'a t5_10; y : 'a}
257
257
type ('a : float64) t5_12 = {x : 'a ; y : float #};;
258
258
[%% expect{|
259
259
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 .
263
271
|}];;
264
272
265
273
type ('a : float64) t5_13 = {x : 'a ; y : float #};;
Original file line number Diff line number Diff line change 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
3
3
^^^^^^
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
Original file line number Diff line number Diff line change @@ -329,7 +329,14 @@ type ('a : immediate) t_imm
329
329
Line 3 , characters 15-39 :
330
330
3 | type s = { f : ('a : value ). 'a -> 'a u }
331
331
^^^^^^^^^^^^^^^^^^^^^^^^
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 .
333
340
|}]
334
341
(* CR layouts v1.5: the location on that message is wrong. But it's hard
335
342
to improve, because it comes from re-checking typedtree, where we don't
Original file line number Diff line number Diff line change @@ -1388,7 +1388,14 @@ type ('a : immediate) t2_imm
1388
1388
Line 3 , characters 15-40 :
1389
1389
3 | type s = { f : ('a : value ) . 'a -> 'a u }
1390
1390
^^^^^^^^^^^^^^^^^^^^^^^^^
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 .
1392
1399
|}]
1393
1400
1394
1401
(* ***************************************************)
Original file line number Diff line number Diff line change @@ -317,8 +317,17 @@ and t2 = Mk1 of t_float64 t | Mk2
317
317
type 'a t8_5 = { x : 'a t8_6 ; y : string }
318
318
and 'a t8_6 = 'a float64_t ;;
319
319
[%% 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 .
322
331
|}]
323
332
324
333
You can’t perform that action at this time.
0 commit comments