ocaml/testsuite/tests/typing-misc/occur_check.ml.reference

16 lines
545 B
Plaintext

# type 'a t = 'a
# Characters 42-43:
let f (g : 'a list -> 'a t -> 'a) s = g s s;;
^
Error: This expression has type 'a list
but an expression was expected of type 'a t = 'a
The type variable 'a occurs inside 'a list
# Characters 42-43:
let f (g : 'a * 'b -> 'a t -> 'a) s = g s s;;
^
Error: This expression has type 'a * 'b
but an expression was expected of type 'a t = 'a
The type variable 'a occurs inside 'a * 'b
#