Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007779OCamltypingpublic2018-04-16 12:062018-04-16 12:09
Reporterlpw25 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version4.06.0 
Target VersionlaterFixed in Version 
Summary0007779: Recursive module inclusion check incomplete
DescriptionThe 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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0019035)
lpw25 (developer)
2018-04-16 12:09

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

- Issue History
Date Modified Username Field Change
2018-04-16 12:06 lpw25 New Issue
2018-04-16 12:09 lpw25 Note Added: 0019035


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker