Skip to content
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

Closed
vicuna opened this issue Dec 8, 2014 · 7 comments
Closed

allow @@ocaml.deprecated on structure items? #6698

vicuna opened this issue Dec 8, 2014 · 7 comments

Comments

@vicuna
Copy link

vicuna commented Dec 8, 2014

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)?

@vicuna
Copy link
Author

vicuna commented Dec 8, 2014

Comment author: @alainfrisch

What's the rationale? Typically, maintaining deprecated definitions is relevant for library modules, and they should always have an explicit interface.

@vicuna
Copy link
Author

vicuna commented Dec 8, 2014

Comment author: @ygrek

they should always have an explicit interface.

This is it - sometimes they don't. Looks like an arbitrary limitation to me for the compiler to enforce this.

@vicuna
Copy link
Author

vicuna commented Dec 9, 2014

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.

@vicuna
Copy link
Author

vicuna commented Dec 10, 2014

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: ...
[@@deprecated]
let foo x = ....
...
...
with:

let foo x = ...
...
...
[@@deprecated]

(this deprecated marker is far from "foo").

@vicuna
Copy link
Author

vicuna commented Jan 8, 2015

Comment author: @damiendoligez

What is the status of this after the merge of signature and structure items?

@vicuna
Copy link
Author

vicuna commented Mar 1, 2017

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.

@vicuna vicuna closed this as completed Mar 1, 2017
@vicuna
Copy link
Author

vicuna commented Mar 1, 2017

Comment author: @alainfrisch

Btw, there has been no merge of signature and structure items for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants