Skip to content

Commit 899010b

Browse files
committed
fix test
1 parent feea377 commit 899010b

File tree

1 file changed

+18
-7
lines changed
  • ocaml/testsuite/tests/typing-layouts

1 file changed

+18
-7
lines changed

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

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,19 +1923,30 @@ Error: Signature mismatch:
19231923
|}]
19241924

19251925
module M6 : sig
1926-
val f : ('a. 'a -> 'a) -> unit
1926+
val f : ('a. 'a -> unit) -> unit
19271927
end = struct
1928-
let f (g : ('a : any). 'a -> 'a) =
1928+
let f (g : ('a : any). 'a -> unit) =
19291929
ignore (g (Stdlib__Float_u.of_float 3.14)); ignore (g "hello"); ignore (g 5); ()
19301930
end
19311931

19321932
[%%expect{|
1933-
Line 5, characters 11-46:
1933+
Lines 3-6, characters 6-3:
1934+
3 | ......struct
1935+
4 | let f (g : ('a : any). 'a -> unit) =
19341936
5 | ignore (g (Stdlib__Float_u.of_float 3.14)); ignore (g "hello"); ignore (g 5); ()
1935-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1936-
Error: This expression has type float# but an expression was expected of type
1937-
('a : value)
1938-
float# has layout float64, which is not a sublayout of value.
1937+
6 | end
1938+
Error: Signature mismatch:
1939+
Modules do not match:
1940+
sig val f : (('a : any). 'a -> unit) -> unit end
1941+
is not included in
1942+
sig val f : ('a. 'a -> unit) -> unit end
1943+
Values do not match:
1944+
val f : (('a : any). 'a -> unit) -> unit
1945+
is not included in
1946+
val f : ('a. 'a -> unit) -> unit
1947+
The type (('a : any). 'a -> unit) -> unit
1948+
is not compatible with the type ('a. 'a -> unit) -> unit
1949+
Type 'a is not compatible with type 'a0
19391950
|}]
19401951

19411952
module M7 : sig

0 commit comments

Comments
 (0)