Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005061OCamltypingpublic2010-05-27 16:542017-08-06 22:08
Assigned Tooctachron 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005061: mutiple value components in signatures should produce a warning or an error
Descriptionmodule type S = sig
  val x : int
  val x : int

as well as

module type S = sig
  val x : int
  val x : bool

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.
TagsNo tags attached.
Attached Files

- Relationships
related to 0004487closedgarrigue Unable to override a value in a module type with ocamlc. 
related to 0004974closed manque de verifications dans les .mli 
related to 0005037closed 3.12.0+dev18: "module type of" produces unusable signatures for repeated definitions 

-  Notes
montagu (reporter)
2010-05-27 16:55

Related to PR#5037
garrigue (manager)
2010-05-28 05:33

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.
Julien Signoles (reporter)
2010-05-28 09:48

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 <module type>".
montagu (reporter)
2010-05-28 11:09

I suggest this warning should be configurable by a command-line flag and switched off by default.
octachron (developer)
2017-08-06 22:08

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.

- Issue History
Date Modified Username Field Change
2010-05-27 16:54 montagu New Issue
2010-05-27 16:55 montagu Note Added: 0005521
2010-05-27 17:01 xclerc Relationship added related to 0004487
2010-05-28 05:33 garrigue Note Added: 0005522
2010-05-28 09:48 Julien Signoles Note Added: 0005524
2010-05-28 11:09 montagu Note Added: 0005525
2010-05-28 17:22 frisch Relationship added related to 0004974
2011-06-01 22:54 doligez Relationship added related to 0005037
2011-06-01 22:55 doligez Severity minor => feature
2011-06-01 22:55 doligez Status new => acknowledged
2016-12-07 18:31 shinwell Category OCaml general => OCaml typing
2017-02-23 16:45 doligez Category OCaml typing => typing
2017-08-06 22:08 octachron Note Added: 0018162
2017-08-06 22:08 octachron Status acknowledged => resolved
2017-08-06 22:08 octachron Resolution open => suspended
2017-08-06 22:08 octachron Assigned To => octachron

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker