-
Notifications
You must be signed in to change notification settings - Fork 21
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
-Xlint:unused false positive with type alias #10313
Comments
I don't think you can do better here than disabling the linter. Macro expansion of dynamic selections means there is no usage either before or after expansion. The code in question might as well be an interpolated string, since all the action is inside the macro. Is it worth disabling the linter automatically if the RHS of a definition includes any macro expansion? But some macros are benign with respect to this sort of sanity check, such as a logger. |
Could the macro cooperate by marking the symbol as used in some way? Unused warnings are too useful to disable altogether and many people like to run with |
Yes, it would be easier to track usages as done by warn-imports, on the fly. Then a macro would have the option of setting a bit somewhere. |
Here is a false positive of
|
@varming That might be worth a separate ticket.
|
With this code:
I get the following warning with
-Xlint:unused
:However, type
X
is clearly used (if I remove it, I get a compile error).Build options:
See also #10296 and scala/scala#5876.
The text was updated successfully, but these errors were encountered: