. It would be super useful within a large codebase, where I need to signal intent to other developers without littering the place with compiler warnings. Is it something that's ever been discussed? I'll raise a ticket if not.
Sam
03/10/2022, 2:05 PM
https://youtrack.jetbrains.com/issue/KT-24746 "Provide ability to exclude specific warnings from compiler option Werror (all warnings as errors)" would be an alternative solution, but
The behaviour I would want would be to see a strikethrough at the use site in the IDE, but no warning emitted by the compiler.
c
christophsturm
03/10/2022, 7:42 PM
for example where would you use this?
s
Sam
03/10/2022, 8:13 PM
I'm writing a lot of shared libraries for use by other developers in a monorepo. But most of our teams have the compiler configured to treat warnings as errors, to keep the code clean. So I'm kind of backed into a corner where I can't deprecate anything unless I immediately go and fix all the places it's used.
Sam
03/10/2022, 8:15 PM
Some of the deprecations I want to make are really just to discourage the widespread use of certain things, even if those things aren't ever going to be totally removed and might have some legitimate uses.
Sam
03/10/2022, 8:17 PM
I tried using "opt in" annotations but it was too heavyweight, I felt like I was spending more time fighting annotations than writing code
Sam
03/10/2022, 8:22 PM
If I had to sum it up, I want a way to mark an API so that anyone trying to use it in future will be notified by the IDE that there's a better alternative, but I don't want to generate compiler warnings and/or build failures for existing uses of that API