| Anonymous | Login | Signup for a new account | 2013-05-25 13:20 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0005342 | OCaml | OCaml general | public | 2011-08-18 16:17 | 2011-12-14 10:22 | |||
| Reporter | elnatan | |||||||
| Assigned To | garrigue | |||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.12.0 | |||||||
| Target Version | Fixed in Version | 3.13.0+dev | ||||||
| Summary | 0005342: "Optional argument cannot be erased" warning is not issued when an optional argument is followed only by labeled arguments | |||||||
| Description | An optional argument that is followed by labeled arguments but by no anonymous arguments cannot be erased, but no warning is issued. # let f ?x ~y = x,y;; val f : ?x:'a -> y:'b -> 'a option * 'b = <fun> # f ~y:();; - : ?x:'a -> 'a option * unit = <fun> | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0006102) lavi (reporter) 2011-08-24 17:04 |
Well, It can be erased, but without any label: # let f ?x ~y = x,y;; val f : ?x:'a -> y:'b -> 'a option * 'b = <fun> # f 1;; - : 'a option * int = (None, 1) |
|
(0006221) garrigue (manager) 2011-12-10 04:19 |
As pointed out in the note, in can be erased by passing all non-optional arguments without labels. |
|
(0006248) elnatan (reporter) 2011-12-12 19:47 |
This is true, but then I think the manual needs correction: http://caml.inria.fr/pub/docs/manual-ocaml/manual006.html [^] says, 'A function taking some optional arguments must also take at least one non-labeled argument.' Also, when warning 6 ('labels were omitted in the application of this function.') is treated as an error, it would helpful to have the unerasable optional argument warning when an optional argument is followed by only labeled arguments. |
|
(0006286) garrigue (manager) 2011-12-14 10:22 |
Fixed the manual, revision 11310. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2011-08-18 16:17 | elnatan | New Issue | |
| 2011-08-24 17:04 | lavi | Note Added: 0006102 | |
| 2011-12-10 04:19 | garrigue | Note Added: 0006221 | |
| 2011-12-10 04:19 | garrigue | Status | new => closed |
| 2011-12-10 04:19 | garrigue | Assigned To | => garrigue |
| 2011-12-10 04:19 | garrigue | Resolution | open => no change required |
| 2011-12-12 19:47 | elnatan | Note Added: 0006248 | |
| 2011-12-12 19:47 | elnatan | Status | closed => feedback |
| 2011-12-12 19:47 | elnatan | Resolution | no change required => reopened |
| 2011-12-14 10:22 | garrigue | Note Added: 0006286 | |
| 2011-12-14 10:22 | garrigue | Status | feedback => closed |
| 2011-12-14 10:22 | garrigue | Resolution | reopened => fixed |
| 2011-12-14 10:22 | garrigue | Fixed in Version | => 3.13.0+dev |
| Copyright © 2000 - 2011 MantisBT Group |