https://kotlinlang.org logo
#getting-started
Title
# getting-started
n

Nikita Yatskivskiy

03/14/2024, 12:24 PM
Hello everyone :) I need to add new method to maintain binary compatibility. I plan to use DeprecationLevel.HIDDEN for the old method. So when can I remove an old HIDDEN-method safely to save binary compatibility?
s

Sam

03/14/2024, 12:59 PM
Well... never. If you remove a function, you're breaking compatibility. One way to do it is to make the change as part of a major version increment, so people know there might be breaking changes.
n

Nikita Yatskivskiy

03/14/2024, 1:01 PM
My library is internal and only projects and other libraries in my company can use it. Can I remove such hidden fun if all projects and other libraries of company will update to the latest version of my library?
s

Sam

03/14/2024, 1:04 PM
Of course. Hidden functions are only useful to consumers that are running against a newer version of the code from the one they were compiled against. If you're in control of all your consumers, you can easily avoid that.
👍 1
n

Nikita Yatskivskiy

03/14/2024, 1:06 PM
Thanks a lot :)