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: 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
The text was updated successfully, but these errors were encountered:
As a side note, this problem is already solved for unification errors: in that case, the internal id for each type is printed. This is not done yet for module coercion errors, but shouldn't be more difficult.
I have a proposition to extend the mechanism used for unification errors to print unambiguous identifier names in various error and warning messages in the PR #1120 .
After the merge of the PR above in 4.08, the error message identifies now the different types t and print if possible the location of their definition:
Values do not match:
val f : t/1 -> unit
is not included in
val f : t/2 -> unit
File "...", line 5, characters 4-21: Expected declaration
File "...", line 8, characters 8-9: Actual declaration
File "...", line 7, characters 4-14:
Definition of type t/1
File "...", line 3, characters 2-12:
Definition of type t/2
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
The text was updated successfully, but these errors were encountered: