Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mutiple value components in signatures should produce a warning or an error #5061

Closed
vicuna opened this issue May 27, 2010 · 5 comments
Closed

Comments

@vicuna
Copy link

vicuna commented May 27, 2010

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.

@vicuna
Copy link
Author

vicuna commented May 27, 2010

Comment author: montagu

Related to #5037

@vicuna
Copy link
Author

vicuna commented May 28, 2010

Comment author: @garrigue

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.

@vicuna
Copy link
Author

vicuna commented May 28, 2010

Comment author: Julien Signoles

I fully disagree with this feature wish.

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 ".

@vicuna
Copy link
Author

vicuna commented May 28, 2010

Comment author: montagu

I suggest this warning should be configurable by a command-line flag and switched off by default.

@vicuna
Copy link
Author

vicuna commented Aug 6, 2017

Comment author: @Octachron

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants