module type Foo = sig
type 'a t
val f : 'a t -> int
end
implicit module Foo1 = struct
type 'a t = unit
let f () = 0
end
implicit module Foo2 = struct
type 'a t = [> `Foo | `Bar ] as 'a
let f (_: 'a t) = 0
end
let f (implicit M: Foo) x = M.f x
let () =
f `Foo ;
()
The following code doesn't compile
cc @def-lkb