The following module is accepted:
module type S1 = sig end
module type S2 = functor (X : S1) -> sig module M = X end
This contradicts https://v2.ocaml.org/manual/modulealias.html, which says that the right-hand side of a module M = M0 in a signature cannot be a functor parameter.
I tried weakly to get this to actually misbehave (accept a program that's clearly not type safe) but was unable to do so. But I think my S2 is uninhabited: I was unable to find a module expression with type S2.
The following module is accepted:
This contradicts https://v2.ocaml.org/manual/modulealias.html, which says that the right-hand side of a
module M = M0in a signature cannot be a functor parameter.I tried weakly to get this to actually misbehave (accept a program that's clearly not type safe) but was unable to do so. But I think my
S2is uninhabited: I was unable to find a module expression with typeS2.