@@ -36,15 +36,7 @@ Error: This type t_value_or_null should be an instance of type ('a : value)
36
36
let should_work (x : t_value_or_null ) = x
37
37
38
38
[%% expect{|
39
- Line 1 , characters 16-37 :
40
- 1 | let should_work (x : t_value_or_null ) = x
41
- ^^^^^^^^^^^^^^^^^^^^^
42
- Error : This pattern matches values of type t_value_or_null
43
- but a pattern was expected which matches values of type ('a : value )
44
- The layout of t_value_or_null is value_or_null, because
45
- of the definition of t_value_or_null at line 1 , characters 0 -36.
46
- But the layout of t_value_or_null must be a sublayout of value, because
47
- we must know concretely how to pass a function argument, defaulted to layout value.
39
+ val should_work : t_value_or_null -> t_value_or_null = < fun>
48
40
|}]
49
41
50
42
(* Type variables in function definitions default to [value]. *)
289
281
[%% expect{|
290
282
Lines 3-5 , characters 6-3 :
291
283
3 | ......struct
292
- 4 | let f x = x
284
+ 4 | let f : type a . a -> a = fun x -> x
293
285
5 | end
294
286
Error : Signature mismatch:
295
287
Modules do not match :
@@ -302,9 +294,9 @@ Error: Signature mismatch:
302
294
val f : ('a : value_or_null ). 'a -> 'a
303
295
The type 'a -> 'a is not compatible with the type 'b -> 'b
304
296
The layout of 'a is value_or_null, because
305
- of the definition of f at line 2 , characters 2 -40 .
297
+ of the definition of f at line 2 , characters 2 -41 .
306
298
But the layout of 'a must be a sublayout of value, because
307
- of the definition of f at line 4 , characters 8 -13 .
299
+ of the definition of f at line 4 , characters 6 -7 .
308
300
| }]
309
301
310
302
(* CR layouts v3.0: annotations on non-rigid type variables are upper bounds.
0 commit comments