ocamllabs/ocaml-modular-implicits

Signature mismatch with implicit functors + aliases

yallop opened this issue · 1 comments

I'm not sure if this is supposed to be supported at the moment, but the current behaviour is rather surprising:

module type S = sig type t end
module type T = sig module M: S end

module N :
sig
  implicit functor F(X: T) = X.M
end =
struct
  implicit functor F(X: T) = X.M
end
Error: Signature mismatch:
       Modules do not match:
         sig implicit functor F (X : T) : sig type t = X.M.t end end
       is not included in
         sig implicit functor F (X : T) = X.M end
       In module F:
       Modules do not match:
         functor (X : T) -> sig type t = X.M.t end
       is not included in
         functor (X : T) -> (module X.M)
       At position module F(X) : <here>
       Modules do not match:
         sig type t = X.M.t end
       is not included in
         (module X.M)
lpw25 commented

For now:

sig
  implicit functor F(X: T) = X.M
end

should be rejected by the parser.

Later we will add support for actual implicit functor aliases.