New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow @@ocaml.deprecated on structure items? #6698
Comments
Comment author: @alainfrisch What's the rationale? Typically, maintaining deprecated definitions is relevant for library modules, and they should always have an explicit interface. |
Comment author: @ygrek
This is it - sometimes they don't. Looks like an arbitrary limitation to me for the compiler to enforce this. |
Comment author: @damiendoligez I still think we should have demanded that every .ml have an explicit .mli. This should be implemented if it's trivial, otherwise it's probably not worth the manpower. |
Comment author: @alainfrisch For type declarations, this is already supported: there is natural correspondence between structure items and generated signatures items. For value bindings, this is less clear: a single value binding (let (x, y) = ... [@@deprecated]) can generate multiple signature items (val x : ... val y : ...). One could declare that all these "val" sig items receive the same attributes as the let binding. Perhaps the best way to support this would be to allow "val" declarations in structures (and keep attributes on those declarations for the corresponding signature items). It would also look nicer. Compare: val foo: ... let foo x = ... (this deprecated marker is far from "foo"). |
Comment author: @damiendoligez What is the status of this after the merge of signature and structure items? |
Comment author: @alainfrisch I'm not convinced this is so useful. It's always possible to add even a local signature if needed to mark something as deprecated. |
Comment author: @alainfrisch Btw, there has been no merge of signature and structure items for now. |
Original bug ID: 6698
Reporter: @ygrek
Assigned to: @alainfrisch
Status: resolved (set by @alainfrisch on 2017-03-01T15:15:34Z)
Resolution: won't fix
Priority: normal
Severity: feature
Version: 4.02.1
Category: typing
Related to: #6688 #6703
Monitored by: @hcarty @alainfrisch
Bug description
Looks like currently @@ocaml.deprecated is checked only on signature items, can it be checked on structure items too (i.e. the inferred str_item will have deprecated marker if the correcespong str_item had it)?
The text was updated successfully, but these errors were encountered: