https://kotlinlang.org logo
Title
a

arekolek

03/26/2019, 11:23 AM
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

robstoll

03/26/2019, 11:25 AM
It should not generate a warning unless you use the deprecated functionality yourself
a

arekolek

03/26/2019, 12:43 PM
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

robstoll

03/26/2019, 1:52 PM
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

arekolek

03/26/2019, 2:40 PM
The best would be to decrease their severity back from error to warning actually
r

robstoll

03/26/2019, 2:54 PM
I guess this feature is not yet supported. You could open a feature request: http://youtrack.jetbrains.com
a

arekolek

03/26/2019, 3:14 PM
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 😄