ocaml-modular-implicits
ocaml-modular-implicits copied to clipboard
Assertion error with implicit of abstract module type
trafficstars
# module F(X : sig module type T end) =
struct
let f (implicit Y:X.T) () = ()
let _ = f ()
end
;;
Fatal error: exception File "typing/implicitsearch.ml", line 400, characters 26-32: Assertion failed
I don't know how to interpret search for an abstract module type. Of course, a clean error message should be provided. Or maybe there is a cleaner way of handling this case?
Maybe treating X.T path as a witness for a module type and searching for implicits in scope having this name as type?
This would allow:
module F(X : sig module type T module M : T end) =
struct
let f (implicit Y:X.T) () = ()
implicit module M = X.M
let _ = f ()
end