ankushg
11/16/2021, 7:52 AM@Deprecated
A couple pain points that are popping up:
1. Deprecated code tends to call other deprecated code, and this generates too many warnings.
I currently have a ton of @Suppress("KotlinDeprecation", "DEPRECATION") @Deprecated
declarations all over my codebase, when there are only one or two actual places that are using the top-level, public Deprecated method.
2. Deprecations in import
statements are tricky.
When I intentionally use a deprecated declaration, I can @Suppress
it at the call site. But I can't @Suppress
the warning I get just for importing it!
For top-level declarations, I can use the fully-qualified name everywhere and just avoid importing the deprecated declaration. This doesn't work when you're using an extension function contained in an object
though.
Questions:
• Is there a way to automatically suppress Deprecation warnings within declarations that are also Deprecated?
• Is there a way to get the compiler to ignore when a @Deprecated
declaration is imported, but still warn when it is used?
• Or alternatively: is there a way I can use a fully-qualified name to avoid importing an extension function contained in an object
?Ruckus
11/16/2021, 3:28 PMankushg
11/16/2021, 3:38 PM