When defining a recursive module with a signature that contains a module type substitution, the substituted module type is not properly checked. This leads to cyclic definitions that make
79ED
s the typechecker loop :
module rec X : (sig module type A end with module type A = X.A)
= struct module type A end (* infinite loop *)
If instead, the substitution is inlined, the typechecker correctly refuses it:
module rec X : (sig module type A = X.A end)
= struct module type A end (* Error: Illegal recursive module reference *)
With type substitutions, the typechecker is not fooled and find the cyclic definition :
module rec X : (sig type t end with type t = X.t)
= struct type t end (* Error: The type abbreviation X.t is cyclic *)
I think the problem might be solved by tweaking those two lines, I will try to investigate.
When defining a recursive module with a signature that contains a module type substitution, the substituted module type is not properly checked. This leads to cyclic definitions that make 79ED s the typechecker loop :
If instead, the substitution is inlined, the typechecker correctly refuses it:
With type substitutions, the typechecker is not fooled and find the cyclic definition :
I think the problem might be solved by tweaking those two lines, I will try to investigate.