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
Original bug ID: 6360 Reporter:@alainfrisch Assigned to:@garrigue Status: confirmed (set by @mshinwell on 2014-05-30T12:13:35Z) Resolution: open Priority: normal Severity: feature Target version: later Category: typing Monitored by:@gasche
Bug description
It 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?
The text was updated successfully, but these errors were encountered:
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.
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.
Original bug ID: 6360
Reporter: @alainfrisch
Assigned to: @garrigue
Status: confirmed (set by @mshinwell on 2014-05-30T12:13:35Z)
Resolution: open
Priority: normal
Severity: feature
Target version: later
Category: typing
Monitored by: @gasche
Bug description
It 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?
The text was updated successfully, but these errors were encountered: