Kotlin deprecated - is it possible to introduce ne...
# intellij
e
Kotlin deprecated - is it possible to introduce new data class constructor where I want to combine two properties into one new data class and have it working with IDE replace action?
Copy code
data class Data(
    val title: String, 
    val action: () -> Unit?, 
    val actionContentDescription: String?
)

data class Data(
    val title: String, 
    val action: ActionData?
)

data class ActionData(
    val action: () -> Unit?, 
    val contentDescription: String?
)
I'm trying with
Copy code
data class Data(
    val title: String, 
    val action: ActionData?
) {
   @Depricated(
       "Use action data", 
       ReplaceWith("DataCtitle, ActionData(action, actionContentDescription)")
   )
   constructor(
    val title: String, 
    val action: () -> Unit?, 
    val actionContentDescription: String?   
   ) : this(....)
}
So far I don't see suggestion in IDE.
Actually, I see suggestion, but what to do with params with default values and named params. Are there is good guide about?
Let me see the stdlib as example
g
It's really tricky case though, this is the main reason for dataarg proposal