Is it possible to use `@Deprecated` annotation whi...
# announcements
a
Is it possible to use
@Deprecated
annotation while having enabled
allWarningsAsErrors = true
/
-Werror
? As far as I can tell it’s impossible, but maybe I missed something?
r
It should not generate a warning unless you use the deprecated functionality yourself
a
Yes, but I’m not thinking about a library or anything and in that case I would just remove the thing instead of annotating it. So what I actually meant is “is it possible to suppress the deprecation warnings (errors), but treat other warnings as errors”.
r
yes, you can suppress deprecations with
@Suppress("DEPRECATION")
(in the same way as for other warnings)
I don't know if you can suppress all deprecation warnings
a
The best would be to decrease their severity back from error to warning actually
r
I guess this feature is not yet supported. You could open a feature request: http://youtrack.jetbrains.com
a
I think I’ll just leave code quality to linters and leave
allWarningsAsErrors
off 😛 But if anybody else thinks it would be useful go ahead 😄