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: 7204 Reporter:@stedolan Assigned to:@lpw25 Status: closed (set by @xavierleroy on 2017-09-24T15:32:11Z) Resolution: duplicate Priority: low Severity: feature Version: 4.02.3 Fixed in version: 4.03.1+dev Category: typing Duplicate of:#7112 Monitored by:@yallop
Bug description
Suppose I write a functor producing an abstract module type:
module type THING = sig
type t
val thing : t
end
module F (X : THING) : sig
module type T
end = struct
module type T = sig type t = X.t end
end
and I make a module of signature THING, and an alias:
module Int : THING = struct
type t = int
let thing = 42
end
module Int2 = Int
I feel that, while abstract, the module types F(Int).T and F(Int2).T are equal. However, signature matching disagrees with me, by rejecting:
module Same (X : F(Int).T) : F(Int2).T = X
On the other hand, as of 4.02.3, the subtyping relation agrees with me, by accepting:
module Same (X : F(Int).T) () : F(Int2).T =
(val ((module X : F(Int).T) :> (module F(Int2).T)))
Is this a simple oversight, or is there some reason to avoid expanding module aliases when comparing abstract module types? How much work would be necessary to make OCaml accept the first version of Same?
(this is low-priority, because I intend to use this ability to write only the most silly of programs)
The text was updated successfully, but these errors were encountered:
Original bug ID: 7204
Reporter: @stedolan
Assigned to: @lpw25
Status: closed (set by @xavierleroy on 2017-09-24T15:32:11Z)
Resolution: duplicate
Priority: low
Severity: feature
Version: 4.02.3
Fixed in version: 4.03.1+dev
Category: typing
Duplicate of: #7112
Monitored by: @yallop
Bug description
Suppose I write a functor producing an abstract module type:
and I make a module of signature THING, and an alias:
I feel that, while abstract, the module types F(Int).T and F(Int2).T are equal. However, signature matching disagrees with me, by rejecting:
On the other hand, as of 4.02.3, the subtyping relation agrees with me, by accepting:
Is this a simple oversight, or is there some reason to avoid expanding module aliases when comparing abstract module types? How much work would be necessary to make OCaml accept the first version of Same?
(this is low-priority, because I intend to use this ability to write only the most silly of programs)
The text was updated successfully, but these errors were encountered: