The following test case fails with OCaml 4.13 but worked perfectly before:
module M : sig
type t
val empty : t
end = struct
type t = unit -> unit
let empty () = ()
end
external test : M.t -> unit -> unit = "%apply"
let () = test M.empty ()
$ ocamlc test.ml
File "test.ml", line 11, characters 14-21:
11 | let () = test M.empty ()
^^^^^^^
Error: This expression has type M.t
This is not a function; it cannot be applied.
M.t is an abstract type but internally a function, which to me should be valid. However OCaml 4.13 somehow treats it as a function and rejects this code with a rather cryptic error message.
Looking into the PRs merged in 4.13 so far, it looks like this was introduced in #10081 (cc @alainfrisch @garrigue)