You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
Original bug ID: 5143
Reporter: montagu
Assigned to: @garrigue
Status: closed (set by @mshinwell on 2017-03-10T08:48:47Z)
Resolution: duplicate
Priority: normal
Severity: feature
Version: 3.12.0
Target version: later
Category: typing
Bug description
Type constraints are not stable under equivalence of module types.
Additional information
module 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 *)
The text was updated successfully, but these errors were encountered: