-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Misplaced attributes for deprecation markers #13054
Comments
The correct syntax is module Top1: sig
...
end[@@deprecated "A"] or module[@deprecated "A"] Top1: sig
...
end The improved warning is reliable in the sense that the warning is now always produced whenever the compiler ignored a builtin attribute which was not the case before. |
This is true for most attributes by design, but for
In @jonludlam's original example I believe we are not in either of these cases - the compiler does issue w53 and does not issue a deprecated warning for uses of elements of this signature - but I will not be terribly surprised if I got this wrong. |
The example in question is indeed a case where the attribute was ignored. |
That makes sense for submodules, and we can change our test cases to look like that. I'm curious though, how would you go about deprecating an entire compilation unit? |
This is the case where a floating attribute in the "header" of the file (before non-attribute items) works: [@@@deprecated "ok"]
val x: int val x:int
[@@@deprecated "not_in_the_header"] And there seems to be a warning 53 bug in this case, since the first form trigger a warning |
(See the related RFC ocaml/RFCs#26 that proposes giving a formal status to this idea of "header of a compilation unit".) |
Just wanted to acknowledge I've seen this and plan to fix it. Sorry for the delay, it's been a busy week. |
I've just been testing odoc's support for 5.2 as contributed by @Octachron, which is working well and passing tests. However, one of our tests is producing a new warning that it wasn't before. The code in question looks like this:
and I'm now getting a misplaced attribute warning:
I saw that @ccasin did a bunch of fixes in this area in #12451 so I had a look through that, but I'm afraid it's still not clear to me that this is expected behaviour. In odoc this is only generating a warning at compile time of the test, and the generated HTML still has the deprecated alert in it, so I think we might be missing a whitelisting of this attribute somewhere. If not, what's the right way to mark a whole module as deprecated?
The text was updated successfully, but these errors were encountered: