Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004904OCaml~DO NOT USE (was: OCaml general)public2009-10-30 16:522017-02-20 10:56
Reporterlukstafi 
Assigned Tofrisch 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0004904: Warn about repeated function arguments especially for optional arguments
DescriptionIf this feature is implemented, the warning should be on by default.

# let f ?(a=0) b ?(a=0) c = a+b+c;;
val f : ?a:int -> int -> ?a:int -> int -> int = <fun>
# f ~a:7 1 2;;
- : int = 3
TagsNo tags attached.
Attached Files

- Relationships
has duplicate 0007029closedgarrigue Proposal: flag duplicate parameters as error 

-  Notes
(0016967)
shinwell (developer)
2016-12-12 16:37

@garrigue Ping (from 2010)...
(0016988)
garrigue (manager)
2016-12-13 01:42

This case is covered by warning 27, which is not enabled by default.
Should we move it to warning 26 (which is enabled by default)?
What could be a good criterion? A combination of unused variable and shadowing?

I move it to Alain, since he is our unused variable specialist...
(0017020)
lukstafi (reporter)
2016-12-17 00:35
edited on: 2016-12-17 00:35

As the original reporter, I would not object for this bug to be closed; perhaps as "Won't fix" -- referring to making this case enabled -- if the unused variable detection "warning 27" is covering this case since time immemorial. If this case (with labeled arguments) can be easily/efficiently differentiated though, it would still be beneficial to move it to warning 26 I think.

(0017361)
frisch (developer)
2017-02-20 10:56
edited on: 2017-02-20 10:56

I confirm that warning 27 is triggered (not in the toplevel, though). I don't think that triggering warning 26 for this case is relevant considering the current description of warning 26 (unused variable that is bound with "let" or "as"). And it would be weird to have a different warning than for

   let f a b a c = a+b+c;;

(which also triggers warning 27)


- Issue History
Date Modified Username Field Change
2009-10-30 16:52 lukstafi New Issue
2010-04-30 03:26 garrigue Status new => assigned
2010-04-30 03:26 garrigue Assigned To => garrigue
2016-12-12 16:37 shinwell Note Added: 0016967
2016-12-12 16:39 shinwell Relationship added has duplicate 0007029
2016-12-13 01:42 garrigue Note Added: 0016988
2016-12-13 01:42 garrigue Assigned To garrigue => frisch
2016-12-13 01:42 garrigue Status assigned => feedback
2016-12-17 00:35 lukstafi Note Added: 0017020
2016-12-17 00:35 lukstafi Status feedback => assigned
2016-12-17 00:35 lukstafi Note Edited: 0017020 View Revisions
2017-02-20 10:56 frisch Note Added: 0017361
2017-02-20 10:56 frisch Note Edited: 0017361 View Revisions
2017-02-20 10:56 frisch Status assigned => closed
2017-02-20 10:56 frisch Resolution open => won't fix
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker