Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005061OCamlOCaml generalpublic2010-05-27 16:542011-06-01 22:55
Reportermontagu 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusacknowledgedResolutionopen 
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
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.
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
(0005521)
montagu (reporter)
2010-05-27 16:55

Related to PR#5037
(0005522)
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.
(0005524)
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>".
(0005525)
montagu (reporter)
2010-05-28 11:09

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

- 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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker