Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006527OCamlOCaml typingpublic2014-08-30 00:522014-09-15 15:22
Reportermkoconnor 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.01.0 
Target Versionafter-4.02.1Fixed in Version 
Summary0006527: constraints dropped on included signature
DescriptionIt seems constraints are dropped when including a signature in the following way:

$ ocaml
        OCaml version 4.01.0

# module type With_constraint = sig type 'a t constraint 'a = [> `Foo] end;;
module type With_constraint = sig type 'a t constraint 'a = [> `Foo ] end
# module type S = sig type 'a t include With_constraint with type 'a t := 'a t end;;
module type S = sig type 'a t end

This surprised me, since the constraint doesn't get dropped if there's a constraint on the type already defined in S:

# module type S' = sig type 'a t constraint 'a = [> `Bar] include With_constraint with type 'a t := 'a t end;;
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 = [> `Bar | `Foo ]
       is not included in
         type 'a t constraint 'a = [> `Foo ]
       Their constraints differ.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2014-08-30 00:52 mkoconnor New Issue
2014-09-15 15:22 doligez Status new => acknowledged
2014-09-15 15:22 doligez Target Version => after-4.02.1


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker