Eugen Martynov

03/08/2023, 11:34 AM
Hi people, I have a compose function with many default params. I want to Deprecate it and propose replace it with new one. However, I’m not sure how to write all possible replace with variants when some parameters are default. Example:
@Deprecated("Use new one", replaceWith("newFun(param1, param2)"))
fun oldFun(param1: Int, param2: String = "test"){}

fun newFun(param1: Int, param2: String = "test){}
Will cover the calls where all params are specified and will add extra non existing param when the second param is defaulted.