File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed
ocaml/testsuite/tests/typing-layouts Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -1923,19 +1923,30 @@ Error: Signature mismatch:
1923
1923
|}]
1924
1924
1925
1925
module M6 : sig
1926
- val f : ('a . 'a -> 'a ) -> unit
1926
+ val f : ('a . 'a -> unit ) -> unit
1927
1927
end = struct
1928
- let f (g : ('a : any ). 'a -> 'a ) =
1928
+ let f (g : ('a : any ). 'a -> unit ) =
1929
1929
ignore (g (Stdlib__Float_u .of_float 3.14 )); ignore (g " hello" ); ignore (g 5 ); ()
1930
1930
end
1931
1931
1932
1932
[%% 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 ) =
1934
1936
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
1939
1950
|}]
1940
1951
1941
1952
module M7 : sig
You can’t perform that action at this time.
0 commit comments