Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005143OCamlOCaml generalpublic2010-09-03 11:252013-06-27 13:39
Reportermontagu 
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version3.12.0 
Target VersionlaterFixed in Version 
Summary0005143: module types and type constraints
DescriptionType constraints are not stable under equivalence of module types.
Additional Informationmodule type S1 = sig
  type t
  type u = t
end

module type S2 = sig
  type u
  type t = u
end

(* S1 and S2 are equivalent signatures, ie. S1 is included in S2 and S2 is included in S1 *)

module type S1' = S1 with type t = int
(* ok *)

module type S2' = S2 with type t = int
(* fails *)
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0005651)
garrigue (manager)
2010-09-05 02:20

I'm afraid this is not a bug.
Namely, two module types can mutually convertible without
being equal.
The specification of constraints is to replace the current
manifest type with a new one. If the current manifest type
was necessary, this is bound to break something.
You can always write:
module type S2' = S2 with type t = int and type u = int
(0005652)
montagu (reporter)
2010-09-05 11:17

No: in 3.12,
module type S2' = S2 with type t = int and type u = int

fails, whereas
module type S2' = S2 with type u = int and type t = int

is accepted.
(0009190)
garrigue (manager)
2013-04-23 02:52

Indeed, but I would rather say that the problem is that the order of with constraints is relevant.
Changing this behavior would require changing the algorithm for with constraints, which I believe is part of the specification.

- Issue History
Date Modified Username Field Change
2010-09-03 11:25 montagu New Issue
2010-09-05 02:20 garrigue Note Added: 0005651
2010-09-05 11:17 montagu Note Added: 0005652
2011-05-20 17:47 doligez Status new => acknowledged
2012-06-01 09:26 garrigue Assigned To => garrigue
2012-06-01 09:26 garrigue Status acknowledged => assigned
2012-07-10 18:30 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-19 14:07 doligez Target Version 4.00.1+dev => 4.01.0+dev
2013-04-23 02:52 garrigue Note Added: 0009190
2013-06-27 13:39 frisch Target Version 4.01.0+dev => later


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker