Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006360OCamlOCaml typingpublic2014-04-03 17:392014-07-16 17:56
Reporterfrisch 
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version 
Target Versionafter-4.02.0Fixed in Version 
Summary0006360: Relaxing the coherence check for with-constraint re-exports
DescriptionIt is possible to specify a re-export of a concrete type in a with-constraint:

 module M = struct type t = A end
 module type S1 = sig type t = A end
 module type S2 = S1 with type t = M.t

Is is expected for this feature to be sensitive to the ordering of with-constraints?

 module M = struct type t = A of s and s = B end;;
 module type S1 = sig type t = A of s and s = B end;;
 module type S2 = S1 with type t = M.t and type s = M.s;; (* fails *)
 module type S3 = S1 with type s = M.s and type t = M.t;; (* succeeds *)


It seems there is no way to use this feature with mutually recursive declarations:

 module M = struct type t = A of s and s = B of t end;;
 module type S1 = sig type t = A of s and s = B of t end;;
 module type S2 = S1 with type t = M.t and type s = M.s;; (* fails *)
 module type S3 = S1 with type s = M.s and type t = M.t;; (* fails *)


Wouldn't it be possible to run the coherence check after all constraints have been applied?
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0011215)
garrigue (manager)
2014-04-04 04:39

The fact the ordering matters is a well-known limitation.
(Basically with constraints are applied incrementally.)
But maybe it was not noted before that this makes impossible to instantiate mutually recursive types.
(0011595)
shinwell (developer)
2014-05-30 14:13

Does this require an addition to the documentation?

- Issue History
Date Modified Username Field Change
2014-04-03 17:39 frisch New Issue
2014-04-04 04:39 garrigue Note Added: 0011215
2014-05-30 14:13 shinwell Note Added: 0011595
2014-05-30 14:13 shinwell Assigned To => garrigue
2014-05-30 14:13 shinwell Status new => confirmed
2014-07-16 17:56 doligez Target Version => after-4.02.0


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker