-
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
Support alert for class methods #13109
Comments
Thanks for the report. That suprises me, because it seems supported in the parser: Line 2060 in 544ce93
|
They are accepted by the parser but not currently interpreted by the compiler. @samwgoldman indeed, off the top of my head I don't see any technical obstacle to supporting alerts on class methods; it just hasn't been done. |
Currently we can only handle deprecated alerts on things that end up in typing environments. A lot of things end up there (most module components, variant constructors, record labels, ...), but methods do not. |
While testing OCaml 5.2 on the Flow codebase, the new unused attribute warning triggered on this code:
https://github.com/facebook/flow/blob/f77ee9d1e4bb18bae47c6e9500a0807fa000f0bb/src/parser/flow_ast_mapper.ml#L1931-L1933
The warning seems legitimate -- the warning is indeed unused. It appears that we can attach the alert to a class definition, but not to its methods. It's easy enough to remove the alert in this case, but would it be possible to actually support alerts in this position?
For example:
The text was updated successfully, but these errors were encountered: