Hey, how could I deprecate a single function param...
# getting-started
h
Hey, how could I deprecate a single function parameter? Example
Copy code
fun createSimulation(
    @Deprecated("use env.enableConsoleLogger() instead")
    enableConsoleLogger: Boolean = false,
    durationUnit: DurationUnit = MINUTES
){ print() }
It seems that the @Deprecated is not applicable for parameters. Thread in Slack Conversation
c
Create a second function without that parameter and mark the original as deprecated
👍 1
h
That's more a workaround that does not scale. Is there a youtrack ticket I could upvote?
e
I'm not sure what you mean by "does not scale". it is the only way, deprecation or not. changing the list of parameters, even if they have defaults, even with
@JvmOverloads
, is ABI-incompatible. so if you care about migration, you need a new function. if you don't care, then just remove the parameter.