Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive module inclusion check incomplete #7779

Open
vicuna opened this Issue Apr 16, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

vicuna commented Apr 16, 2018

Original bug ID: 7779
Reporter: @lpw25
Status: new
Resolution: open
Priority: normal
Severity: minor
Version: 4.06.0
Target version: later
Category: typing

Bug description

The following code does not type check:

module rec M : sig
  type a
  type b = a
end = struct
  type a
  type b = M.b
end;;
Characters 53-93:
  ........struct
      type a
      type b = M.b
    end..

Error: Signature mismatch:
       Modules do not match:
         sig type a = M.a type b = M.b end
       is not included in
         sig type a type b = a end
       Type declarations do not match:
         type b = M.b
       is not included in
         type b = a

Having dug into the issue, this appears to just be part of the incompleteness of the current inclusion check for recursive modules.

I don't expect it to be fixed unless the approach taken by that check is changed, but I thought I'd make this issue anyway to record it for posterity.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Apr 16, 2018

Comment author: @lpw25

For completeness, the following example is the one that I actually started looking at -- partly due to its dubious error message -- but the problem is the same as that of the more minimal example above:

module rec M : sig
  type a
  module type B = sig val x : M.a end
end = struct
  type a
  module type B = M.B
end;;

Characters 78-125:
  ........struct
    type a
    module type B = M.B
  end..
Error: Signature mismatch:
       Modules do not match:
         sig type a = M.a module type B = M.B end
       is not included in
         sig type a module type B = sig val x : M.a end end
       Module type declarations do not match:
         module type B = M.B
       does not match
         module type B = sig val x : M.a end
       At position module type B = <here>
       Modules do not match: M.B is not included in sig val x : M.a end
       At position module type B = <here>
       Values do not match: val x : M.a is not included in val x : M.a

@vicuna vicuna added the typing label Mar 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.