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
Both of those behaviours are intended.
I.e., if you write
let x = 1
let x = "hello"
this is perfectly valid ocaml, and the visible result is a value x of type string (the first definition gets hidden).
The same behaviour is now available for signatures.
I'm not sure what kind of error a warning would help catch.
Dear ocaml developers, please keep the current behavior (keeping the last declaration): do not warn nor fail since it will break many existing codes which intensively override signatures using "include ".
The interest of this feature request seems tenuous, it goes against a behavior in action for more than five years, and the purpose of this feature is still unclear. I am therefore suspending this issue, waiting for an explanation of the intended purpose of the proposed warning.
Original bug ID: 5061
Reporter: montagu
Assigned to: @Octachron
Status: resolved (set by @Octachron on 2017-08-06T20:08:22Z)
Resolution: suspended
Priority: normal
Severity: feature
Category: typing
Related to: #4487 #4974 #5037
Monitored by: "Julien Signoles"
Bug description
module type S = sig
val x : int
val x : int
end
as well as
module type S = sig
val x : int
val x : bool
end
is accepted and keeps the last value component since 3.12.
It should produce a warning or an error.
The same remark applies with inclusion of signatures.
The text was updated successfully, but these errors were encountered: