Source

mutated_ocaml / testsuite / tests / typing-typeparam / newtype.ml.reference

Full commit

#       val property : unit -> ('a -> exn) * (exn -> 'a option) = <fun>
#                         false
true
true
false
#         val sort_uniq : ('a -> 'a -> int) -> 'a list -> 'a list = <fun>
#       abc,xyz
#   Characters 33-34:
  let f x (type a) (y : a) = (x = y);; (* Fails *)
                                  ^
Error: This expression has type a but an expression was expected of type a
       The type constructor a would escape its scope
#       Characters 117-118:
    method n : 'a -> 'a = fun (type g) (x:g) -> self#m x
                                                       ^
Error: This expression has type g but an expression was expected of type g
       The type constructor g would escape its scope
#