Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007834OCamltypingpublic2018-07-31 17:542018-09-03 06:55
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0007834: Problem with constraints, with type, and polymorphic variants
DescriptionThe following code seems pretty reasonable:

  module type Q = sig
    type 'a t constraint 'a = [< `Empty | `Filled of _ ]
    module type S = sig
      type 'a t constraint 'a = [< `Empty | `Filled of _ ]
    module M : S with type 'a t = 'a t

but fails with the following error:

  Error: In this `with' constraint, the new definition of t
  does not match its original definition in the constrained signature:
  Type declarations do not match:
       type 'a t = 'a t constraint 'a = [< `Empty | `Filled of 'b & 'c & 'd ]
     is not included in
       type 'a t constraint 'a = [< `Empty | `Filled of 'b ]
     Their constraints differ.

I haven't dug into this issue properly, but I can see basically how it happens. I'm not really sure there is much we can do to fix it, I suspect it would require comparing the different `&`ed types, and that has been ruled out as a too much of a PITA before. Still I figured it was worth reporting anyway.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2018-07-31 17:54 lpw25 New Issue

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker