| Anonymous | Login | Signup for a new account | 2013-05-25 05:04 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 | |||||||
| 0005596 | OCaml | OCaml general | public | 2012-04-18 16:48 | 2012-04-20 17:03 | |||||||
| Reporter | Boris Yakobowski | |||||||||||
| Assigned To | frisch | |||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||||||
| Status | resolved | Resolution | fixed | |||||||||
| Platform | OS | OS Version | ||||||||||
| Product Version | ||||||||||||
| Target Version | Fixed in Version | |||||||||||
| Summary | 0005596: Erroneous warning on unused private constructor | |||||||||||
| Description | ---------- mli ------------- module C : sig type t val inject : t end ---------- ml ------------- module C : sig type t = private I val inject : t end = struct type t = I let inject = I end let _v = C.inject --------------------------- Constructor I is incorrectly marked as unused. | |||||||||||
| Additional Information | Svn 12372 | |||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
Notes |
|
|
(0007380) frisch (developer) 2012-04-18 20:08 edited on: 2012-04-18 20:46 |
Well spotted. In your example, it is not wrong to say that I is unused (you can turn the private definition in an abstract one!). But clearly, something is wrong: if there were other constructors in the same sum type, it would not possible to remove that one (and one might want to use this constructor only in patterns). I think one needs a different treatment for sum type definitions in module interfaces so as not to report them as being unused. Another example is: module F(X : sig type t = A | B end) = struct let f = function X.A -> 0 | X.B -> 1 end |
|
(0007381) frisch (developer) 2012-04-18 20:46 edited on: 2012-04-18 20:47 |
Fixed in trunk (commit 12378) and 4.00 (commit 12379). Constructors in signatures are no longer reported as unused. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-04-18 16:48 | Boris Yakobowski | New Issue | |
| 2012-04-18 20:02 | frisch | Assigned To | => frisch |
| 2012-04-18 20:02 | frisch | Status | new => assigned |
| 2012-04-18 20:08 | frisch | Note Added: 0007380 | |
| 2012-04-18 20:14 | frisch | Note Edited: 0007380 | View Revisions |
| 2012-04-18 20:46 | frisch | Note Added: 0007381 | |
| 2012-04-18 20:46 | frisch | Note Edited: 0007380 | View Revisions |
| 2012-04-18 20:47 | frisch | Note Edited: 0007381 | View Revisions |
| 2012-04-20 17:03 | frisch | Status | assigned => resolved |
| 2012-04-20 17:03 | frisch | Resolution | open => fixed |
| Copyright © 2000 - 2011 MantisBT Group |