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: 6788 Reporter: milanst Assigned to:@yallop Status: closed (set by @xavierleroy on 2016-12-07T10:47:14Z) Resolution: duplicate Priority: normal Severity: minor Version: 4.02.1 Category: typing Duplicate of:#6786
Bug description
This was discussed on caml-list. It seems that type checker in some cases drops module alias information but not always.
It looks like a bug in the type checker.
Steps to reproduce
module type S = sig type t end
module Make (M : sig end) : S = struct type t end
module M : sig
type t
module C : S with type t = t
end = struct
module C = struct
module T = struct end
include Make (T)
end
include C
end
The above fails to compile with following error:
Error: Signature mismatch:
Modules do not match:
sig
module C : sig module T : sig end type t = Make(T).t end
module T = C.T
type t = Make(T).t
end
is not included in
sig type t module C : sig type t = t end end
In module C:
Modules do not match:
sig module T : sig end type t = Make(T).t end
is not included in
sig type t = t end
In module C:
Type declarations do not match:
type t = Make(T).t
is not included in
type t = t
This seems to say that C.t is not the same as Make(T).t. But the following compiles which seems to say that all type [t]s that I have are the same.
module type S = sig type t end
module Make (M : sig end) : S = struct type t end
module M : sig
type t
val f1 : t -> unit
val f2 : t -> unit
val f3 : t -> unit
val f4 : t -> unit
end = struct
module C = struct
module T = struct end
include Make (T)
end
include C
let f1 (x : t) = ()
let f2 (x : Make(C.T).t) = ()
let f3 (x : C.t) = ()
let f4 (x : Make(T).t) = ()
end
The text was updated successfully, but these errors were encountered:
Original bug ID: 6788
Reporter: milanst
Assigned to: @yallop
Status: closed (set by @xavierleroy on 2016-12-07T10:47:14Z)
Resolution: duplicate
Priority: normal
Severity: minor
Version: 4.02.1
Category: typing
Duplicate of: #6786
Bug description
This was discussed on caml-list. It seems that type checker in some cases drops module alias information but not always.
It looks like a bug in the type checker.
Steps to reproduce
module type S = sig type t end
module Make (M : sig end) : S = struct type t end
module M : sig
type t
module C : S with type t = t
end = struct
module C = struct
module T = struct end
include Make (T)
end
include C
end
The above fails to compile with following error:
Error: Signature mismatch:
Modules do not match:
sig
module C : sig module T : sig end type t = Make(T).t end
module T = C.T
type t = Make(T).t
end
is not included in
sig type t module C : sig type t = t end end
In module C:
Modules do not match:
sig module T : sig end type t = Make(T).t end
is not included in
sig type t = t end
In module C:
Type declarations do not match:
type t = Make(T).t
is not included in
type t = t
This seems to say that C.t is not the same as Make(T).t. But the following compiles which seems to say that all type [t]s that I have are the same.
module type S = sig type t end
module Make (M : sig end) : S = struct type t end
module M : sig
type t
val f1 : t -> unit
val f2 : t -> unit
val f3 : t -> unit
val f4 : t -> unit
end = struct
module C = struct
module T = struct end
include Make (T)
end
include C
let f1 (x : t) = ()
let f2 (x : Make(C.T).t) = ()
let f3 (x : C.t) = ()
let f4 (x : Make(T).t) = ()
end
The text was updated successfully, but these errors were encountered: