| Anonymous | Login | Signup for a new account | 2013-05-20 02:32 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 | ||||||
| 0005854 | OCaml | OCaml general | public | 2012-12-14 14:10 | 2012-12-14 14:34 | ||||||
| Reporter | ppedrot | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | feature | Reproducibility | have not tried | ||||||
| Status | new | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | |||||||||||
| Target Version | Fixed in Version | ||||||||||
| Summary | 0005854: Add a deprecated warning | ||||||||||
| Description | It would be nice to be able to flag functions as deprecated directly in the source code, so that ocamlc/opt would spit out a warning when using such a function. This would ease code maintenance a lot. | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Notes |
|
|
(0008610) gasche (developer) 2012-12-14 14:34 edited on: 2012-12-14 14:36 |
I guess it is currently possible to do that by inspection of the .cmt file spit out by the -bin-annot files: traverse AST in the .cmt and check for uses of deprecated functions; to be integrated in your compilation&test toolchain. To declare a function deprecated you could either just give the traverser-tool a list of deprecated functions, or use a hack to embed the annotation as valid OCaml source code (not what I would choose): deprecate.mli type 'a t = 'a in your code: let f = ... in ignore (f : _ Deprecate.t); I'm not sure we want to integrate this ad-hoc feature directly in the language itself -- I'd rather wait until someone comes with a decent pragmas/annotations proposal. In the meantime I think a bin-annot-based tool could suit your needs. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-12-14 14:10 | ppedrot | New Issue | |
| 2012-12-14 14:34 | gasche | Note Added: 0008610 | |
| 2012-12-14 14:36 | gasche | Note Edited: 0008610 | View Revisions |
| Copyright © 2000 - 2011 MantisBT Group |