-
Notifications
You must be signed in to change notification settings - Fork 1.2k
The same string can mean different types in the same error message #6416
Description
Original bug ID: 6416
Reporter: dwang
Assigned to: @Octachron
Status: resolved (set by @Octachron on 2018-06-26T20:19:28Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: x86 64-bit
OS: Linux CentOS 6
OS Version: 2.6.32-358.23.2.
Version: 4.01.0
Fixed in version: 4.08.0+dev/beta1/beta2
Category: typing
Related to: #4791
Monitored by: @gasche
Bug description
Compile this code:
module M = struct
type t = A
module M : sig
val f : t -> unit
end = struct
type t = B
let f B = ()
end
end
The error is
Values do not match: val f : t -> unit is not included in val f : t -> unit
Line 4, characters 4-21: Expected declaration
Line 7, characters 8-9: Actual declaration
I would prefer the error to be more explicit that there are two
different types here both named 't'.
Steps to reproduce
Compile this code:
module M = struct
type t = A
module M : sig
val f : t -> unit
end = struct
type t = B
let f B = ()
end
end